how to append one file's line to another file's line?

how to append one file's line to another file's line?

Post by Bin L » Thu, 27 May 1999 04:00:00



I am not very farmiliar with UNIX. Now I met a problem. I want join two files
text line together. That's :

        line1 from file1        line1 from file2
        line2 from file1        line2 from file2
        .
        .
        .

I don't know if I can do this through shell scripts. the questions is I don't
know how to process another file in a shell scripts.

Thank you,

Bill.

 
 
 

how to append one file's line to another file's line?

Post by Steve Bellen » Thu, 27 May 1999 04:00:00




Quote:>I am not very farmiliar with UNIX. Now I met a problem. I want join two files
>text line together. That's :

>    line1 from file1        line1 from file2
>    line2 from file1        line2 from file2
>    .
>    .
>    .

>I don't know if I can do this through shell scripts. the questions is I don't
>know how to process another file in a shell scripts.

With shell scripts? Hmmm... perhaps add line numbers to each file and
do a join?

Tcl or perl will allow you the have several files open at the same time
which isn't possible in a shell script.

--


 
 
 

how to append one file's line to another file's line?

Post by peter holme » Thu, 27 May 1999 04:00:00



> I am not very farmiliar with UNIX. Now I met a problem. I want join two files
> text line together. That's :

>         line1 from file1        line1 from file2
>         line2 from file1        line2 from file2
>         .
>         .
>         .

> I don't know if I can do this through shell scripts. the questions is I don't
> know how to process another file in a shell scripts.

Try "man paste".  Hope this helps.

Peter

 
 
 

how to append one file's line to another file's line?

Post by peter holme » Thu, 27 May 1999 04:00:00




> > I am not very farmiliar with UNIX. Now I met a problem. I want join two files
> > text line together. That's :

> >         line1 from file1        line1 from file2
> >         line2 from file1        line2 from file2
> >         .
> >         .
> >         .

> > I don't know if I can do this through shell scripts. the questions is I don't
> > know how to process another file in a shell scripts.

> Try "man paste".  Hope this helps.

Just took a look at "man paste" and the examples aren't clear for what
you're trying to do.  It's just "paste file1 file2 > file3" to get the
concatenated output thrown in file3.
 
 
 

how to append one file's line to another file's line?

Post by Andrew Blat » Thu, 27 May 1999 04:00:00


How about the join command.. (Do a man on join)


------------


> I am not very farmiliar with UNIX. Now I met a problem. I want join two files
> text line together. That's :

>         line1 from file1        line1 from file2
>         line2 from file1        line2 from file2
>         .
>         .
>         .

> I don't know if I can do this through shell scripts. the questions is I don't
> know how to process another file in a shell scripts.

> Thank you,

> Bill.

 
 
 

how to append one file's line to another file's line?

Post by Peter Sundstro » Fri, 28 May 1999 04:00:00


Pretty simple:

paste <file1> <file2>


>I am not very farmiliar with UNIX. Now I met a problem. I want join two
files
>text line together. That's :

> line1 from file1        line1 from file2
> line2 from file1        line2 from file2
> .
> .
> .

>I don't know if I can do this through shell scripts. the questions is I
don't
>know how to process another file in a shell scripts.

>Thank you,

>Bill.

 
 
 

how to append one file's line to another file's line?

Post by Peter Sundstro » Fri, 28 May 1999 04:00:00


join needs a relational field to join on.


>How about the join command.. (Do a man on join)


>------------


>> I am not very farmiliar with UNIX. Now I met a problem. I want join two
files
>> text line together. That's :

>>         line1 from file1        line1 from file2
>>         line2 from file1        line2 from file2
>>         .
>>         .
>>         .

>> I don't know if I can do this through shell scripts. the questions is I
don't
>> know how to process another file in a shell scripts.

>> Thank you,

>> Bill.

 
 
 

how to append one file's line to another file's line?

Post by Mick Farm » Sat, 29 May 1999 04:00:00


Dear Bill,

Depending on how you want to merge the lines, try pr with
the -m option.

Regards,

Mick