mcasspj has asked for the wisdom of the Perl Monks concerning the following question:
Back to Perl after a long, too long break!
I wish to make a csv data file (for R) and I have a series of files consisting of lists of single items.
Rather than open the first file, outputing the first line to a new (output) file then opening the second file, reading the first item and appending it to the first line of the output file and so on until I run out of input files then doing the same for the second line I'm sure there must be a more elegant way.
I know the files all have the same number of lines so don't need to worry about this.
Somehow I'm guessing the solution uses
while (<>) {}
but not sure how to handle the handles (no pun intended!) Cheers Paul
while (<>) {}
but not sure how to handle the handles (no pun intended!) Cheers Paul
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Opening multiple files
by Eliya (Vicar) on Jan 29, 2012 at 21:41 UTC | |
by kielstirling (Scribe) on Jan 30, 2012 at 01:45 UTC | |
by Eliya (Vicar) on Jan 30, 2012 at 02:08 UTC | |
by kielstirling (Scribe) on Jan 30, 2012 at 02:11 UTC | |
Re: Opening multiple files
by kielstirling (Scribe) on Jan 30, 2012 at 01:42 UTC | |
by mcasspj (Initiate) on Jan 30, 2012 at 16:45 UTC | |
Re: Opening multiple files
by Anonymous Monk on Jan 29, 2012 at 20:48 UTC | |
by Anonymous Monk on Jan 30, 2012 at 01:09 UTC | |
by Anonymous Monk on Nov 21, 2012 at 11:01 UTC | |
by Anonymous Monk on Feb 27, 2013 at 10:28 UTC | |
by mcasspj (Initiate) on Jan 30, 2012 at 10:59 UTC |
Back to
Seekers of Perl Wisdom