Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

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
38
Helped
9
Reputation
18
Reaction score
8
Trophy points
1,288
Activity points
1,535
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:
 

ernpao

Advanced Member level 4
Joined
Sep 16, 2010
Messages
100
Helped
26
Reputation
52
Reaction score
24
Trophy points
1,298
Activity points
2,043
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.
 

kirteshmiet

Member level 1
Joined
Feb 16, 2012
Messages
38
Helped
9
Reputation
18
Reaction score
8
Trophy points
1,288
Activity points
1,535
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top