Since I found this very helpful forum and friendly people, I have a small request.
I use AIX Unix and would like to know if there's a simple way how to do a kind of compare between two files. Should I use some grep or script?
I have 2 text files, let's name them file1 and file2.
What I need:
I want to read line by line file1 - certain field or better 2 fields of the file1 and look up the information in the file2.
To be more descriptive: I'd like to extract field1 at position 10-15 and field2 at position 25-31 from file1 and search or find if the same information is somewhere inside the file2. When no, I'd like to output the field1 & field2 off the file1 doesn't exit in file2.
let's say file1 contains something like:
123232 3232 2323 2323123123213 trterert
and file2 e.g.
123232 3232 2323 2323123123213 XXXXXXXX
and let's say I want 123232 & trterert from file1 to be searched in file2 ==> I get an "error" because the script would find only 123232 and not trterert.....
I'd be more than happy if someone can help me out or recommend a link or appropriate command or script.
I just need to check some record(s) in one file - and if they're available in the other file...
Any suggestions please? Thanks.
I use AIX Unix and would like to know if there's a simple way how to do a kind of compare between two files. Should I use some grep or script?
I have 2 text files, let's name them file1 and file2.
What I need:
I want to read line by line file1 - certain field or better 2 fields of the file1 and look up the information in the file2.
To be more descriptive: I'd like to extract field1 at position 10-15 and field2 at position 25-31 from file1 and search or find if the same information is somewhere inside the file2. When no, I'd like to output the field1 & field2 off the file1 doesn't exit in file2.
let's say file1 contains something like:
123232 3232 2323 2323123123213 trterert
and file2 e.g.
123232 3232 2323 2323123123213 XXXXXXXX
and let's say I want 123232 & trterert from file1 to be searched in file2 ==> I get an "error" because the script would find only 123232 and not trterert.....
I'd be more than happy if someone can help me out or recommend a link or appropriate command or script.
I just need to check some record(s) in one file - and if they're available in the other file...
Any suggestions please? Thanks.
Comment