go ahead... be a heretic | |
PerlMonks |
file copy and create csv problemsby grashoper (Monk) |
on Apr 14, 2009 at 14:32 UTC ( [id://757400]=perlquestion: print w/replies, xml ) | Need Help?? |
grashoper has asked for the wisdom of the Perl Monks concerning the following question:
I have a series of files in a series of directories, I would like to merge the contents of all the files into one big fat csv file, which would go in a new location. files are csv formatted, want to make a giant csv that will be used to input the data from the files into sql.
I would like to make it recursive from dirpath to end of tree and put the file generated into a different location..I have something like this which creates the csv but I am stumped on how to make it a regular script.
perl -F -lane '@F %2 and push @D,{q{Stamp},@F} or $D-1={% {$D-1},@F}}{$,=",";print @{$_}{qw(Stamp Login searchload)}for @D' input.txt
Back to
Seekers of Perl Wisdom
|
|