Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: GAWK error ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 8 Topic 2201 of 2241
Post > Topic >>

Re: GAWK error : replace newline with tab in WinXP ?

by Hermann Peifer <peifer@[EMAIL PROTECTED] > Mar 25, 2008 at 10:11 AM

On Mar 25, 4:50=A0pm, John Bartley K7AAY <john.bart...@[EMAIL PROTECTED]
> wrote:
> awk 'ORS=3D%NR%1?",":"\t"' %1.tsv > %1.csv
>
> This line of code, adapted
fromhttp://www.ee.ucl.ac.uk/~hamed/misc/awk1lin=
e.txt
> fails for me while running GNUWIN32 gawk 3.1.0 =A0

There is a bug in the example on this page.

> I am trying to take a three line file and turn it into a one-line, tab-
> separated file, so I can (later on) concatenate multiple files into
> one CSV for import into Excel.
>
> Thank you kindly in advance.
>

Try this, which works for me on Linux:  awk 'ORS=3DNR%3?"\t":"\n"'

For Windows environment: the quoting has to be adapted.

Hermann




 8 Posts in Topic:
GAWK error : replace newline with tab in WinXP ?
John Bartley K7AAY <jo  2008-03-25 08:50:33 
Re: GAWK error : replace newline with tab in WinXP ?
Hermann Peifer <peifer  2008-03-25 10:11:14 
Re: GAWK error : replace newline with tab in WinXP ?
Kam-Hung Soh <kamhung.  2008-03-25 19:11:54 
Re: GAWK error : replace newline with tab in WinXP ?
Kam-Hung Soh <kamhung.  2008-03-25 20:30:38 
Re: GAWK error : replace newline with tab in WinXP ?
John Bartley K7AAY <jo  2008-03-26 09:02:46 
Re: GAWK error : replace newline with tab in WinXP ?
Hermann Peifer <peifer  2008-03-26 19:40:20 
Re: GAWK error : replace newline with tab in WinXP ?
Harlan Grove <hrlngrv@  2008-03-26 13:57:58 
Re: GAWK error : replace newline with tab in WinXP ?
"Rajan" <svr  2008-03-26 20:50:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 5:21:54 CDT 2008.