To: | erlug <erlug@xxxxxxxxxxxxxx> |
---|---|
Subject: | Re: [Erlug] vim: da space delimited file a tab delimited |
From: | Federico Calboli <f.calboli@xxxxxxxxxxxxxx> |
Date: | Fri, 27 May 2005 11:06:34 +0100 |
On Fri, 2005-05-27 at 10:49 +0200, Enrico Zini wrote: > O in alternativa, si può fare cosí: > > 1) Prima si contano le righe del file: > > wc -l file > /tmp/conto > > 2) Poi si dividono le due colonne: > > cut -d' ' -f1 file > file.col1 > cut -d' ' -f2 file > file.col2 > > 3) Infine, si rimettono assieme i due file usando tab invece di spazi: > > CONTO=`cat /tmp/conto` > for i in `seq 1 $CONTO` > do > LINEA=`head -n 1 file.col1 | tail -n 1` > LINEB=`head -n 1 file.col2 | tail -n 1` > echo -n "$LINEA" >> file1 > echo -ne '\t' >> file1 > echo "$LINEB" >> file1 > done > R U sure it works? Fede PS it doesn't 4 me |
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
|
Previous by Date: | [Erlug] internet provider, Marco Fabbri |
---|---|
Next by Date: | [Erlug] [pr@xxxxxxxx: ILDP news], Maurizio Lemmo - Tannoiser |
Previous by Thread: | Re: [Erlug] vim: da space delimited file a tab delimited, Luciano Varotti |
Next by Thread: | Re: [Erlug] vim: da space delimited file a tab delimited, Enrico Zini |
Indexes: | [Date] [Thread] [Top] [All Lists] |