Computing.Net > Forums > Unix > Simple UNIX script or command?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Simple UNIX script or command?

Reply to Message Icon

Name: netrom
Date: September 28, 2005 at 05:38:57 Pacific
OS: UNIX AIX
CPU/Ram: 256
Comment:

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.

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...

Please!

Thanks a lot!

Marian




Sponsored Link
Ads by Google

Response Number 1
Name: Dlonra
Date: September 28, 2005 at 17:03:30 Pacific
Reply:

AIX contains all the *NIX utilities: ksh, sed, awk, etc.

What is your experience in *nix shell programming?
in PERL?


0

Response Number 2
Name: netrom
Date: September 28, 2005 at 23:11:38 Pacific
Reply:

Sorry, I have no experience with programming - that's my pity! :-(

Can you help me out?

Thanks!

Marian


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Compare Fields in two Fil... Extracting of data



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Simple UNIX script or command?

HELP(short unix scripts) www.computing.net/answers/unix/helpshort-unix-scripts/4246.html

Run a Unix Script from VB or ASP www.computing.net/answers/unix/run-a-unix-script-from-vb-or-asp-/4384.html

Unix Script Error, Quel Strange www.computing.net/answers/unix/unix-script-error-quel-strange/5244.html