NEED HELP FROM SHELL EXPERTS ASAP ..Compare of two files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting NEED HELP FROM SHELL EXPERTS ASAP ..Compare of two files
# 1  
Old 04-05-2012
NEED HELP FROM SHELL EXPERTS ASAP ..Compare of two files

I have seen the old forums before posting this thread...I did not find the designated answer for my shell script... I am novice in shell programming:

Can some one help on how i can loop with in the loop when comparing two files...

I need to compare ID in File1 with IDs in File2...If the ID match output to File3. If the ID in FILE1 do not find in FILE2 then check to see what id is that (compare should be wild card) like if file1 id = 'un*' then output all the "un*" ids into file4 otherwise rest of the ids to go into file5.

File1 looks like:
Code:
UN1234
UNRC01
UNKEYU
A1NM8
A7IOK9

File2 looks like :
Code:
A1NM8
A7IOK9
A4IOP4
K2IOU9

Please help me...
Thanks Smilie

Last edited by joeyg; 04-06-2012 at 02:48 PM..
# 2  
Old 04-06-2012
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to compare two files for duplicate..??

Hi , I had a requirement to compare two files whether the two files are same or different .... like(files contaisn of two columns each) file1.txt 121343432213 1234 64564564646 2345 343423424234 2456 file2.txt 121343432213 1234 64564564646 2345 31231313123 3455 how to... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

2. Shell Programming and Scripting

Compare two files using shell scripting

Hi, I need to compare two files using shell scripting. Say like: File1 AAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBBBBBBBB CCCCCCCCCCCCCCCCCCCCCCCCC eeeeeeeeeeeeeeeeeeeeeeeee DDDDDDDDDDDDDDDDDDDDDDDDDDDD File2 BBBBBBBBBBBBBBBBBBBBB DDDDDDDDDDDDDDDDDDDDDDDDDDDD AAAAAAAAAAAAAAAAAAAA ... (6 Replies)
Discussion started by: roshParab
6 Replies

3. Shell Programming and Scripting

Compare two files using shell script

Hi i want to compare two files and i need the o/p of only difference here the files file1 achilles aedxbepo aedxbwdm01 aedxbwdm02 albedo amarice ambrister anakin anton argon artephius asgard avatar aymara (10 Replies)
Discussion started by: venikathir
10 Replies

4. Shell Programming and Scripting

Need help to write a shell script ASAP

Hi, 1) Need help to write script in KSH to detect a duplicate file. 2) The original file needs to be moved from current path to a different path 3) The duplicate file should continue to stay in the same path. Exact file names & duplicate file names are given below. Please help me at the... (7 Replies)
Discussion started by: bhagya3001
7 Replies

5. Shell Programming and Scripting

Shell script to compare two files

I have two files; file A and file B. I need all the entries of file A to be compared with file B line by line. If the entry exists on file B, then save those on file C; if no then save it on file D Note :- all the columns of the lines of file A need to be compared, except the last two columns... (8 Replies)
Discussion started by: ajiwww
8 Replies

6. Shell Programming and Scripting

Shell Script to Compare Two Files

I have a directory with about 6 files that we receive regularly. these 6 files contain information for 3 different units, 2 for each unit. files related to a specific unit are named similarly with a change in number at the end of the file. the numbers should be sequential. for each grouping of... (3 Replies)
Discussion started by: scriptman237
3 Replies

7. UNIX and Linux Applications

Log files to view job executed in Autosys -- Help ASAP

Hi all, I really need your help ASAP on this. Below is the description of my problem and a sketch of Autosys Job Activity Console ++++++++++++++++++++++++++++++++ File View Options +++++++++++++++++++++++++++++++ Job Name Description Status Command Machine... (1 Reply)
Discussion started by: sakal_woman
1 Replies

8. UNIX and Linux Applications

How to compare two files using shell script

hi experts please help me to compare two files which are in different directory file1<file will be master file> (/home/rev/mas.txt} ex x1 x2 file2 <will be in different folder> (/home/rev/per/.....) ex x3 x4 the filesinside per folder i need to compare with master file... (1 Reply)
Discussion started by: revenna
1 Replies

9. Shell Programming and Scripting

Compare one file with 7 files in shell programming

hi , I am new to shell. i have a requirement to compare the one file from one dir to other 7 files of other dir and to find out the duplicate files from the 7 files . the name of the all files go on changing every weekend. Thanks in advance (4 Replies)
Discussion started by: ravi214u
4 Replies

10. Shell Programming and Scripting

Shell Coding question for any experts out there

Given this one long stream of data (all one line): <TransactionDetail><TransactionHeader><ErrorLogging>YES</ErrorLogging><HistoryLogging>YES</HistoryLogging><ErrorDetection>NO</ErrorD... (4 Replies)
Discussion started by: dfran1972
4 Replies
Login or Register to Ask a Question