RE: [U2] Unix cat help

2007-06-20 Thread Stevenson, Charles
grep '' fileA fileB | sort -n -t: -k2 grep will prepend file name if you grep thru multiple files. If you grep for '', you'll get every line. Then sort by what follows the colon. As an example, suppose 2 files: fileA:3 fileA fileB 14 1 13 3

RE: [U2] Unix cat help

2007-06-20 Thread Jerry Banker
Why not just use unibasic? Just copy the files to a type 19 file accessible from u2 and do what you want to do. -Original Message- From: Adrian Merrall [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 19, 2007 5:10 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Unix cat help On 6/20

RE: [U2] Unix cat help

2007-06-20 Thread Symeon Breen
TECTED] On Behalf Of [EMAIL PROTECTED] Sent: 20 June 2007 05:47 To: u2-users@listserver.u2ug.org Subject: RE: [U2] Unix cat help Outstanding!!! Thanks very much to you, Adrian, Rodney, John, and Stewart. -- Original message -- From: "[EMAIL PROTECTED]" <[EMAIL

RE: [U2] Unix cat help

2007-06-20 Thread Andre Beaud
Hi, You can also do this in sed, which I use when I need speed: (sed "s/^/file1*/" file1;sed "s/^/file2*/" file2)|sort -t* -k2 Cheers, Andre Date: Wed, 20 Jun 2007 13:33:21 +1000 From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Subject: RE: [U2] Unix cat he

RE: [U2] Unix cat help

2007-06-19 Thread iggchamp
Outstanding!!! Thanks very much to you, Adrian, Rodney, John, and Stewart. -- Original message -- From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > Stewart Leicester wrote: > > > perl -lne 'print "$ARGV*$_"' file1 file2 | sort -t* -k2,99 > > newfile > > Or just do

RE: [U2] Unix cat help

2007-06-19 Thread [EMAIL PROTECTED]
Stewart Leicester wrote: > perl -lne 'print "$ARGV*$_"' file1 file2 | sort -t* -k2,99 > newfile Or just do it in awk: awk '{printf("%s*%s\n",FILENAME,$0)}' file1 file2 | sort -t* -k2,999 Gotta say I was surprised that the '*' delimeter in the sort command didn't need to be escaped with \, but i

Re: [U2] Unix cat help

2007-06-19 Thread Stewart Leicester
At 9:37 PM + 6/19/07, [EMAIL PROTECTED] wrote: before... /sws/scott/temp: pg file1 line1 line1 line1 line1 line1 line2 line2 line2 line2 line2 line3 line3 line3 line3 line3 /sws/scott/temp: pg file2 line1 line1 line1 line1 line1 line2 line2 line2 line2 line2

RE: [U2] Unix cat help

2007-06-19 Thread John Hester
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] [snip] > I have 2 unix flat files that I want to merge into 1 file. I > know that I can do something like "cat file1 file2 | sort -o > newfile". The problem is that once I hav

RE: [U2] Unix cat help

2007-06-19 Thread Baakkonen, Rodney A (Rod) 46K
Maybe some UNIX guru has a more elegant way than this. I do a lot of shell scripting. So the easiest way to do this was with a script. I am using korn shell for this. Most U2 people I know avoid shell scripts. I wrote a quick somewhat generic script to do it called rod.test. You give it the t

Re: [U2] Unix cat help

2007-06-19 Thread Adrian Merrall
On 6/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi all, > > Hopefully there is a way to do this... > > I have 2 unix flat files that I want to merge into 1 file. I know that I > can do something like "cat file1 file2 | sort -o newfile". The problem is > that once I have newfile loade