![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem joining 2 files | rochitsharma | UNIX for Advanced & Expert Users | 4 | 04-03-2008 07:12 AM |
| Help with joining two files | rjlohman | Shell Programming and Scripting | 3 | 09-27-2006 12:55 PM |
| Joining lines from two files - please help | chandra004 | Shell Programming and Scripting | 25 | 07-27-2006 03:39 AM |
| joining files | Manu | UNIX for Dummies Questions & Answers | 2 | 04-25-2005 01:24 PM |
| joining 2 files | webtekie | UNIX for Dummies Questions & Answers | 1 | 10-21-2003 11:51 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Joining 2 CSV files together
I need a little help as I am a complete novice at scripting in unix. However, i am posed with an issue... i have two csv files in the following format@
FILE1.CSV: HEADER HEADER Header , , HEADER 001X ,,200 002X ,,300 003X ,,300 004X ,,300 FILE2.CSV: HEADER HEADER Header , , HEADER 001X ,,300 003X ,,500 005X ,,600 006X ,,100 I need the above to files to merged into on final file as below: FINAL_MERGED.CSV: HEADER HEADER Header , , HEADER 001X ,,300 002X ,,300 003X ,,500 004X ,,300 005X ,,600 006X ,,100 I have tried using the join command but that only lets me to join the two files but as you can see from the above i need the ability to be able to overwrite values from file 1 whith those in file 2. The logic behind it is that the first csv (FILE1.CSV) file is produced but may have incorrect figures associated with it. Once the information is readily available the second csv (FILE2.CSV) is produced with the correct figures and any missing codes. Once this has been done file 1 and file 2 need to be merged to have the correct figures from file 2 and also to include any missing codes that are on file 2 but not file 1. I need to do this in Unix, my initial thoughts were to use the join command but not sure if this is possible but may be some use of lookup could be done... again i am a programming and unix newbie so would appreciate any assistance. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|