Help cross-referencing files

Jack quiet_celt at yahoo.com
Mon Apr 18 14:13:12 CDT 2005


--- Brad <brad at bradandkim.net> wrote:
> 
> > How about: 
> > home:~$join file1 file2 > file2a
> > home:~$join file2a file3 > file3a
> > 
> > syntax : join [options] <file1 name> <file2 name>
> > 
> > Or at least that used to be the syntax. It may
> have
> > changed. 'Man join' or 'info coreutils join'
> should
> > get you there. also you can specify which field is
> the
> > match field for each file with options -1 and -2.
> > Also, the files have to be sorted on the key
> field.
> > 
> > I know this may not be as exciting as writing an
> awk
> > or shell script, but it should get the job done.
> And
> > if you need to remove any columns from the final
> file
> > "cut" should do the job.
> > 
> > So if you need to sort the files then match them
> and
> > then cut fields out:
> > 
> > !/bin/bash
> > # my file merger script
> > sort -k12.14 vpifile > file1
> > sort -k1.14 ipfile > file2
Oops!
That should read:
sort -k=12.14 vpifile > file1
sort -k=1.14 ipfile > file2

etc.

Computers are soooooooo picky about typos. ;')
Kind of like KCLUG that way, but fortunately I caught
it before being slammed by the syntax nazis. ;')

> 
> This looks like just what I need.  I will research
> this more...thanks.
> 
Good. Let me know if it works.

Brian D.


		
__________________________________ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs


More information about the Kclug mailing list