Hi,
Maybe a biggy but I want to make it clear what i'm trying to achieve......
I'm a big stuck and need a bit of a pointer. I'm not sure how to explain this.
My input file follows the format below. When I read the file each time I get a ~FILE? I want to assign it to var1 then each num/value that is comma seperated will be assigned to var2 and used to execute a diff comamnd/script.
Example: script ~FILE1 1
script ~FILE1 2
File format. (lines beginning with comma , are continuation of previous line and are new line seperated after 7 entries, numbers will never follow a sequence like in this example)
~FILE1,1,2,3,4,5,6,7
,8,9
~FILE2,1a,2a,3a
~FILE3,1b,2b,3b,4b,5b,6b,7b
,8b,9b,10b,11b
Once a get to the next ~FILE? that becomes var1 and subsequent , comma speerated fields become var2 and are used on the same script.
Example: script ~FILE2 1a
How can I read the line and seperate each in the way that I want? I have played around with read and shift and a few other no hopers to achive nothing. I end up with var1 and var2 being the same string I get no strings assigned to either var.
Any help will be great.....
Cheers and beers to the winner....