Oct 12, 2012, 4:58 AM
Post #1 of 5
Hi guys, I am a complete beginner when it comes to perl, and I have been set a task that is beyond me.
Relatively simple data extraction
I have a whole bunch of files, each with 6 columns of data. I need to extract the first 2 columns of data from each of these files and have them all print out into an outfile.
The files that are being extracted from are sequential, so the data needs to be extracted in order. When I say sequential I mean like "file.1.1, file.3.1, file.5.1, etc".
I feel like I could probably use a cat command to paste the whole thing into one file and then just use sed to delete the last 4 columns, but I was hoping someone could show me a better way in perl?
(This post was edited by shlam16 on Oct 12, 2012, 5:05 AM)