Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Combining columns of multiple files in one file

I have several hundred text files that contain a lot of information. Each file has 3 columns (the first two are the same for all the files).

I need to merge the third column of all the files in a new file. And insert a column header with the name of the file from where the column belongs.


The txt files with the three columns like this:


-118.33333333333279 40.041666666667908 11.409999847412109

-118.29166666666612 40.041666666667908 11.090000152587891

-118.24999999999946 40.041666666667908 10.920000076293945

-118.20833333333279 40.041666666667908 10.949999809265137


The txt file I am trying to create should look like this:

User uploaded file

Is this possible? I can't find a way to do so. Please help!!!


Pepo

MacBook Air, OS X Mavericks (10.9.2)

Posted on Apr 14, 2014 7:27 PM

Reply
Question marked as Best reply

Posted on Apr 14, 2014 8:10 PM

You say you have several hundred files with 3 columns of data in them. You want to take out the 3rd column from each file and create a new file that contains all the 3rd columns.


This seems to imply the output file will have several hundred columns in it. Is that correct?

3 replies

Combining columns of multiple files in one file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.