I have a file that is a list of cars with the year/make/model as the description. ex- 2011 Chevy Camaro Some of the cars have extended model names like: 2011 Dodge Ram Crew Cab Short Bed What I want to do is have it parse and split to year/make/model and i have this
I'm not sure how to adjust for the model name being more than one word.open (FILE, 'E:\ptest\cars.txt'); while (<FILE>) { chomp; ($year, $make, $model) = split(" "); print "$year "; print "$make "; print "$model \n"; } close (FILE); exit;
In reply to Parse file, split by mewoq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |