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
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
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
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
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
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
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
> -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
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
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
10 matches
Mail list logo