Need to merge first column of one and third column of second file in another file

Status
Not open for further replies.

kirteshmiet

Member level 1
Joined
Feb 16, 2012
Messages
39
Helped
11
Reputation
24
Reaction score
12
Trophy points
1,288
Activity points
1,544
Hello friends!
Here is the scenario.
I have two files named FILE1.TXT and FILE2.TXT with multiple columns and comma as delimiter.
Now my task is to create another file called FILE3.TXT which contains the FIRST column values from FILE1.TXT & THIRD column values from FILE2.TXT separated by comma.
Which mean i am creating a new files with only two columns which are 1st and 3rd. Ex:
FILE1.TXT
1,2
1,2
1,2
1,2
1,2

FILE2.TXT
4,2,3
4,2,3
4,2,3
4,2,3
4,2,3

Now after creating another file FILE3.TXT it should look like this:
FILE3.TXT
1,3
1,3
1,3
1,3
1,3

Thanks in advance.:thumbsup::thumbsup:
 

Try renaming the extension of your file to .csv instead of .txt. So:

FILE1.TXT -> FILE1.CSV

You should be able to open the .csv files in MS Excel with the data arranged appropriately. Copying/Merging the columns should be much easier now.
 

Hi ernpao ,
Thanks for your suggession, but in my case open office is not there and also i can not copy data from my workstation to pc . so i have to do this with commands of unix . using awk sed vi etc.

Thanks
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…