file compare and result output
hello;
i have two files 100kactivesept.csv and 100kactivevms.csv the two files are really long, however i want to spit out both results of field1 in file1 that are not in field 2 of file 2, and the vice versa, field 2 in file1 not in field one in file 1. hope am making sense. Quote:
Quote:
|
As far as I could understand your requirement, if you want only 2nd field of first file and 1st field of second file, then do as:
1st file: % more <filename> | awk -F"," '{print $2}' > /tmp/firstfile.txt and for 2nd file: % more <filename> | awk -F"|" '{print $1}' > /tmp/secondfile.txt Then you'll get your desired output in /tmp/firstfile.txt and /tmp/secondfile.txt. Moreover if you want to merge output of both /tmp/firstfile.txt and /tmp/secondfile.txt in columned manner, use following cmd: % paste /tmp/firstfile.txt /tmp/secondfile.txt Hope it will help you, else explain your question little more. |
THIS DOES NOT GIVE THE DESIRED OUTPUT, I WOULD Like to get field ones that are not in field to of file 1, sort of like a vlookup
|
^ what have you tried so far... i think awk, grep, sed, cut, ... would be useful in this exercise.
i would change one of the files so that the fields match and run grep -f -v in a while loop. |
Quote:
|
Yes, please give examples and written explanation of how some parts of each file match. In the sample you provide, I can see almost no matching strings. For the sake of optimization, it would be useful to know a few more things:
Your second sample file doesn't really look like a CSV formatted file. Are we to assume what the field delimiters are? --- rod. |
All times are GMT -5. The time now is 02:26 PM. |