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.

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
     line3 line3 line3 line3 line3

after...
     /sws/scott/temp: pg newfile
     file1*line1 line1 line1 line1 line1
     file2*line1 line1 line1 line1 line1
     file1*line2 line2 line2 line2 line2
     file2*line2 line2 line2 line2 line2
     file1*line3 line3 line3 line3 line3
     file2*line3 line3 line3 line3 line3

Thanks in advance for any thoughts you may have.

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

Reply via email to