Computing.Net > Forums > Unix > CSH & awk two files > one file

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.

CSH & awk two files > one file

Reply to Message Icon

Name: amaussa
Date: March 26, 2005 at 02:21:47 Pacific
OS: SOLARIS
Comment:

nawk -f ama.awk equiv.txt name.txt
#---------- ama.awk ------------------
FNR == NR {
arr[$1]=$2;
next;
}
{
if ( $2 in arr )
$2 = arr[$2];
print;
}
---------

if the order of the columns changes in the Name file how to make to modify the program. file EQUI.txt contains
old code new code
11125879 211125648
13562452 311115642
the file NAME.txt contains the old code which can be in column 1, 2 or 3..



Sponsored Link
Ads by Google

Response Number 1
Name: amaussa
Date: April 4, 2005 at 08:35:58 Pacific
Reply:

could you help me to undestand how works the programme ama.awk line by line.
If I have another file name.txt with three columm and I want to compare the columm one of equi.txt with the columm tree of name.txt
is it possible ?


0
Reply to Message Icon

Related Posts

See More







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: CSH & awk two files > one file

CSH & awk two files > one file www.computing.net/answers/unix/csh-amp-awk-two-files-one-file/6673.html

Awk from two files into one file www.computing.net/answers/unix/awk-from-two-files-into-one-file/6194.html

To combine two files to one file www.computing.net/answers/unix/to-combine-two-files-to-one-file/7204.html