joining fileds from separete files
Hi
I want to join some fields from a file and some other fields from other files. What if the first file lines are not the same as the second one? |
hi there,
can you post an example of your files and what exactly you want to achieve? regards, slackie1000 |
Hi again
I did that join with the sdiff command. Then, i manipulated the file by the vi and i fixed as i wish. thanks for your response |
Hi,
I am working with similar task. I have set of 8 files, that contain location data. One file is original, upon which all the others are based on. The files are different revisions of the same file, containing several additions (and perhaps also edits) to the original data. I need to merge these files into one, which contains all the original data and all the added lines, with all duplicate lines removed. This is how it looks like: Yuma;USA;Colorado;-102.832977777778;40.1329777777778;-7.0 Yupojin;Korea;Hambuk;129.0002;43.0110333333333;9.0 Zamora;Spain;;-5.7552;41.4990888888889;1.0 Zanesville;USA;Ohio;-82.0082555555556;39.9382555555555;-5.0 Zaragoza;Spain;;-0.8802;41.6568666666667;1.0 Zduny;Poland;Wielkopolska;17.3832555555556;51.6499222222222;1 I was trying to get the task done with sdiff: Code:
sdiff -o locations.txt -s locations.dat locations1.dat Thanks. |
How about a plain
cat file1 file2 file3 | sort -u > newfile Cheers, Tink |
Oh thanks, that helped a lot! Good to learn about sort and uniq -commands! =)
In fact this is what I used: cat *.dat > sort -u > locations.txt; cat locations.txt | sed s/,/./d | uniq -u > newfile2.txt Still I see some characters are in latin-1 or latin-15, while others are in UTF-8. Wondering how do I correct that? Lappeenranta;Finland;Etel�-Karjala;28.183333;61.066667;1.000000 Mets�hovi;Finland;;24.395556;60.216944;1.000000 |
All times are GMT -5. The time now is 07:10 AM. |