...
3 6 8 09
5 7 9 5
END
$$$$
5 9 0 -7
7 9 3 6
END
$$$$
I have a CSV file which contains data related to each group above. The first row in the CSV is a header row with column names.
My csv looks like
Column 1, Column 2
Data 1, Data 2
Data 3, Data 4
I would like to end up with an output file like:
...
3 6 8 09
5 7 9 5
END
> <Column 1>
Data 1
> <Column 2>
Data 2
$$$$
5 9 0 -7
7 9 3 6
END
> <Column 1>
Data 3
> <Column 2>
Data 4
$$$$
Basically, the csv data has been merged between the END keyword and $$$$. I have tried:
while (<DATAFILE>){ $string = $string.$_; } @individual = split /\$\$\$\$/,$string; foreach $i (@individual){ print "inside outer foreach\n"; foreach $h (@headers){ print "inside header foreach - appending tags\n"; @seperate = $i."> <$h>\n"; } @seperate = $i.'$$$$'; } open (OUT, ">outtest.out"); print OUT @seperate;
What this does is just print '$$$$'.
Any help appreciated.
Thanks - Joe.
@headers came from just reading the first line of the csv
In reply to Appending data to large files by joec_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |