realz has asked for the wisdom of the Perl Monks concerning the following question:
I have a file that i have to read...the data is delimited by string 'chr(9)' sample data
DataAchr(9)DataBchr(9)DataCi want to use split function to put this into an array...
if i do the following i get an error...here's my code
open (OBFILE, 'outbound.txt'); open (OBout, '>outbound_output.txt'); while (<OBFILE>) { chomp; $re = 'chr(9)'; @array= split(/$re/,$_); #print OBout "$date\t$time\t$ani\t$entid\n"; print "@array\n"; } close(OBFILE); close(OBout);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split() help
by GrandFather (Saint) on Jan 24, 2008 at 00:30 UTC | |
|
Re: split() help
by runrig (Abbot) on Jan 24, 2008 at 00:17 UTC | |
|
Re: split() help
by Anonymous Monk on Jan 24, 2008 at 01:30 UTC | |
|
Re: split() help
by chrism01 (Friar) on Jan 24, 2008 at 06:11 UTC |