selva has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I have one file contains list of records. Each field in the record are delimited by ^D character.
I am trying to get each field value by using split function with delimiter as ^D, but it is not giving expected result.
$FileLocation="/home/RND/Sample.txt"; open ($FILE, $FileLocation) or die "$!"; my @arr = <$FILE>; my (@LineDetails); foreach $line (@arr) { @LineDetails = split (/chr(4)/,$line); print $_."\n" foreach ( @LineDetails ); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: split a line by control ^D character
by eyepopslikeamosquito (Archbishop) on Dec 02, 2012 at 10:55 UTC | |
by selva (Scribe) on Dec 02, 2012 at 11:12 UTC | |
by eyepopslikeamosquito (Archbishop) on Dec 02, 2012 at 11:17 UTC | |
Re: split a line by control ^D character
by rjt (Curate) on Dec 02, 2012 at 11:38 UTC | |
Re: split a line by control ^D character
by karlgoethebier (Abbot) on Dec 02, 2012 at 18:37 UTC | |
Re: split a line by control ^D character
by rcrews (Novice) on Dec 04, 2012 at 18:29 UTC |
Back to
Seekers of Perl Wisdom