J
Javier
Greetings..
my file looks something like this..
item1 item2 6
itemA itemB 3
itmeX item1 1
I'm reading a list
MYFILE = "/myItems.txt";
$/="\n";
while(<MYFILE>){
push(@list,$_);
}
while this gives me each line ..
@list[0] item1 item2 6
@list[1] itemA itemB 3
what I need is the list to be like this
@list[0] item1
@list[1] item2
@list[3] 6
@list[4] itemA
@list[5] itemB
my problem is that I can only define one separator at the time.
How can I tell the parser to use "\n" and " " as separators?
Thanks for your help.
Javier.
my file looks something like this..
item1 item2 6
itemA itemB 3
itmeX item1 1
I'm reading a list
MYFILE = "/myItems.txt";
$/="\n";
while(<MYFILE>){
push(@list,$_);
}
while this gives me each line ..
@list[0] item1 item2 6
@list[1] itemA itemB 3
what I need is the list to be like this
@list[0] item1
@list[1] item2
@list[3] 6
@list[4] itemA
@list[5] itemB
my problem is that I can only define one separator at the time.
How can I tell the parser to use "\n" and " " as separators?
Thanks for your help.
Javier.