i have a file a with contents
and a file b with contents
i want to compare records in file a to file b such that when the name tom is found in file b column 1 and has either newyork or ohio or oregon IN Column 3 display as
else display
so the output of file a after comparison should be
since tom has either newyork or ohio or oregon in column3 of file b
Moderator's Comments:
You were already asked in another thread to use code tags - you also got a warning PM with a guide how to use them and still don't do so. If you collect 30 points by such tiny things like this, you will be banned from the forum. So please start obeying mod guidances or tell us what you do not understand.
Last edited by zaxxon; 02-02-2011 at 11:47 AM..
Reason: code tags
I hope that this helps, but your desired output is a little inconcistent, so I've had to guess. have a play and let us all know how you get on or if you need more help.
Robin
Liverpool/Blackburn
UK
Last edited by rbatte1; 02-02-2011 at 01:01 PM..
Reason: Closing and signature
Many thanks Scott. I am a fool in my coding. I read the text saying column 3 and just coded it straight.
So, dealerso, now with proper testing, I found that my logic was in reverse too.
Amended & testing code appended:-
From the input given, I get the output:-
Not quite what is shown, but that would be more to code, unless you really want the spaces around the pipe mark for record tom.
Does that fix things up? Let us all know if this is the answer or if I have missed something.
I have two file as given below which shows the ACL permissions of each file. I need to compare the source file with target file and list down the difference as specified below in required output. Can someone help me on this ?
Source File
*************
# file: /local/test_1
# owner: own
#... (4 Replies)
Hi....I'm having 2 xml files, one is having some special characters and another is a clean xml file does not have any special characters. Now I need one audit kind of file which will show me only from which line the special characters have been removed and the special characters.
Can you please... (1 Reply)
Hi Guys ,
we have one directory ...in that directory all files will be set on each day..
files must have header ,contents ,footer..
i wants to compare the header,contents,footer ..if its same means display an error message as 'files contents same' (7 Replies)
I have 2 files of almost same text apart from 2,3 ending lines. Now I want to get that difference in another file.
e.g file1.txt is
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_livecd-lv_root
18G 2.4G 15G 14% /
tmpfs 504M ... (12 Replies)
Shell : Korn
os : AIX
This is the ps output looking for a process called pmon. pmon runs with various 'service' names which is appended with an underscore as shown below.
For example a pmon process for the service hexjkm will be named ora_pmon_hexjkm
$ ps -ef | grep pmon
oracle... (1 Reply)
Hi Guys,
I need to compare the sql output with a column present in a file.
I am able to read the column from the file and stored in a variable.
Can somebody help how to store output of the below query to a variable. The database is Oracle.
Select count(*) from tableName;
... (2 Replies)
I've two files with data like below:
file1.txt:
AAA,Apples,123
BBB,Bananas,124
CCC,Carrot,125
file2.txt:
Store1|AAA|123|11
Store2|BBB|124|23
Store3|CCC|125|57
Store4|DDD|126|38
So,the field separator in file1.txt is a comma and in file2.txt,it is |
Now,the output should be... (2 Replies)
I have a need to take the output of the who command and first strip out users with only 1 session, then of the remaining users I need only to list the ones who are using more than 1 IP address
Normal output:
tander01 pts/113 Feb 11 09:21 (10.25.1.23)
tbanks pts/81 ... (4 Replies)
I need a perl script which will create an output file after comparing two diff file in a directory path:
/export/home/abc/file1
/export/home/abc/file2
File Format: <IP>TAB<DeviceName><TAB>DESCRIPTIONS
file1:
10.1.2.1.3<tab>abc123def<tab>xyz.mm1.ppp.... (2 Replies)