|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Joining files
hi,
May somebody suggest me how to join 2 or more tables in Unix side-by-side? Sometnimg like: file1 2.45 5.65 2.54 2.45 ... file1 2.45 5.65 2.54 2.45 ... newFile 2.45 5.65 2.45 5.65 2.54 2.45 2.54 2.45 ... Number of columns in this files are variable and all have more then 10 columns. Is there an easy way to do this like to merge files with cat? Thank you in advance oliver |
|
#2
|
||||
|
||||
|
Are you allowed to use a programming language such as perl? If so, this is a trivial task to do. Let us know if you need help with this.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
||||
|
||||
|
It's doable with a few loops in bash, but you could do with using perl really as scorpy recommended.
__________________
~James [Not currently seeking freelance work] Like philosophy or interested in spirituality? Philosophorum. Game Dev Experts Forums Foresight Linux - Because your desktop should be cool! Linux FAQ FedoraFAQ UbuntuGuide |
|
#4
|
|||
|
|||
|
Your requirements are too vague. Do you only want to join lines that are identical, or start with N identical columns? What do you want to do if there are lines that don't match? Or do you want to join the lines of each file regardless of what they contains, i.e. line 1 to line 1, line 2 to line2 etc?
Take a look at the 'join' command - it may do exactly what you want. Or it may not, its hard to tell from your description. Other possible commands are 'paste' and 'comm'. Dave |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Joining files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|