[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: which is the best command to use



On Fri, Dec 23, 2011 at 4:13 PM, Roman Khomasuridze
<khomasuridze@gmail.com> wrote:
> You can use paste, and/or join. for you particular example
> paste -d ' ' a.txt b.txt > ab.txt
> will work

Thanks cool. a derived question,

for a.txt:
1 a
2 a
3 a

for b.txt
1 b
2 b
3 b

what if I only interested the 2 filed.

namely
a b
a b
a b

I tried use paste -d ' ' a.txt b.txt | awk 'print $2, $4'
are there some other way of doing it?

No doubt it's a very smart list, I wasted 1 hour writing some not
sound python script, it's a bunch of files anyway.

Thanks again,
>
> Regards
> --
> Roman
>
>
>
> On Fri, Dec 23, 2011 at 12:07 PM, Arno Schuring <aelschuring@hotmail.com>
> wrote:
>>
>> >
>> > well, I have two files:
>> >
>> > File_a.txt
>> > a
>> > a
>> > a
>> >
>> > File_b.txt
>> > b
>> > b
>> > b
>> >
>> > I wish to get a file_ab.txt as
>> > a b
>> > a b
>> > a b
>> >
>>
>> man 1 paste
>>
>>
>> Regards,
>> Arno
>>
>
>


Reply to: