[ubuntu-florida] AWK

Ayan George ayan.george at canonical.com
Fri Sep 24 05:17:02 BST 2010


 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?





More information about the Ubuntu-us-fl mailing list