Let me restate.
I have variying numbers of fields due to my original
output source. The original output source is not a
database program.
The last two fields of each record are consistent and all
preceeding fields need to be combined into one.
In the output I want just 3 Fields. The first field would be
the instructions, the second, the plant name, the third, a
number. What is intended to be the first field
could be spread to 1, 2, or more fields.
Try this input example (The first row has 4 comma
separated fields, the second 3, the third 5)
Pick the , flower , Primrose , 332
plant the seed , Begonia , 235
dig a hole , five feet , deep , Yellow Rose , 463
to
(Output: each row has 3 comma separated fields, working
from the right.)
Pick the flower , Primrose , 332
plant the seed , Begonia , 235
dig a hole five feet deep , Yellow Rose , 463
I want to use the last two fields as an anchor and combine
everything else. Is it possible?
Wait...
I think I could try printing the fields backwards starting
with the maximum field number, $8 , $7..$1
then remove double "," separators at the begining with
sed until text, then pring the new field $1, $2 and
combine all remaining fields.
Thanks for helping me think this out. I'll try this.
Thanks,
Natalie