Mailing List Archive


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

Re: [tlug] Sed question



On Mon, 2003-02-17 at 17:27, Matt Gross wrote:
> I'm looking a quick sed fix to a problem I'm faced
> with.  I have a file with many lines of data.  What I
> need to do is concatenate the second line to the end
> of the first line.  That's all.  Does anyone know how
> this can easily be done with sed?  Is there an easier
> way to do this other than sed?
> 
> Thanks,
> 
> Matt

Here is a solution with awk:

NR==1 {save = $0; next;}
NR==2 {print save, $0; next;}
{print;}

br.

-- 
GPG Key: 653514E5 (http://www.raoult.com/gpg)
--
Computers are like air-conditions. They don't properly work, if you open
Windows.

Attachment: signature.asc
Description: This is a digitally signed message part


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links