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/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 loaded, I need to know where each line in
newfile
> came from.  I am hoping that unix has something similar to the REUSE()
> function so I can prefix each line with the filename.  Here is an
example of
> what I would like to get done.
>

Scott,

There is probably a shorter way to do this using awk or sed but that awk
man
page is still stuck on my "things I should learn" list.

A couple of simple bash shell only solutions would be as below.

infile=file1
outfile=/tmp/mynewfile

for i in `cat $infile` ; do
   echo "$infile*$i" >> $outfile
done

or

while read i ; do
   echo "$infile*$i" >> $outfile
done < $infile


HTH

Adrian
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to