Using the code you provided I was able to see what needed to be done.. Thank you. However, I have a small question. To pull in the alpha char I was unable to use \w and went with what you had [[:alpha:]] otherwise I would pull in all entries.
So here is the question... what is the difference between \w and :alpha:
By running the code you can see there is a difference between the two.
\w is the same as [:word:] which is the same as: a-zA-Z0-9_
[:alpha:] matches only letters a-zA-Z for which perl has no equivalent shortcut character class.
How can I take a datafile that has a special character and have mult arrays. First array catches everything before the special character �$� and the second array catches everything after the special character?
Abc is good for me $4.55
Def might not be enough $5.66
Ghi price to play $6.77
$
$ cat data.txt
Abc is good for me $4.55
Def might not be enough $5.66
Ghi price to play $6.77
$
$ perl -ne 'chomp; split /\$/; push @a1,$_[0]; push @a2,$_[1]; END{foreach $i(@a1){print $i,"\n"} foreach $i(@a2){print $i,"\n"}}' data.txt
Abc is good for me
Def might not be enough
Ghi price to play
4.55
5.66
6.77
$
$