[ubuntu-florida] AWK
j.e.aneiros
jesus.aneiros at gmail.com
Mon Sep 27 13:11:48 BST 2010
This particular script doesn't take care of the values in the lines, it
reads the entire line as a whole and puts it back without changes. It only
takes care of a line that has certain set of chars at the beginning of the
line (with the pattern /^set,/) and then verifies if a header was already
printed with the checking of the printed variable at the if part. But you
can work with CSV or any other kind of text delimited file using the special
var FS.
On Fri, Sep 24, 2010 at 12:17 AM, Ayan George <ayan.george at canonical.com>wrote:
> On 09/22/2010 09:11 PM, j.e.aneiros wrote:
> >
> > Two days ago I was confronted with a simple task: We have around 50
> > CSV files that should be concatenated into one file. Every file has a
> > header at the first line that should be eliminated except for the
> > first one. To solve the problem I used a different way that the one
> > that I will present to you today: streamed the files through sed
> > deleting all the headers and putting the result into a temp file and
> > then add a header to that file but today I was thinking that it could
> > be a good opportunity to use AWK [1] for the task and write to the
> > list about it.
> >
>
> That is pretty cool. In dealing with CSV files with AWK, I think
> handling embedded commas, quotes, and new-lines pretty interesting.
> Does your script handle those as well?
>
>
>
> --
> Ubuntu-us-fl mailing list
> Ubuntu-us-fl at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-fl
>
--
J. E. Aneiros
GNU/Linux User #190716 en http://counter.li.org
perl -e '$_=pack(c5,0105,0107,0123,0132,(1<<3)+2);y[A-Z][N-ZA-M];print;'
PK fingerprint: 5179 917E 5B34 F073 E11A AFB3 4CB3 5301 4A80 F674
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-us-fl/attachments/20100927/cadf7dde/attachment.htm
More information about the Ubuntu-us-fl
mailing list