[LUAU] not using SED to extract song, artist, and album from my iTunes Music List Export

Jim Thompson jim at netgate.com
Thu Sep 28 03:08:21 PDT 2006


On Sep 27, 2006, at 11:54 PM, Vince Hoang wrote:

> On Tue, Sep 26, 2006 at 11:14:50PM -1000, R. Scott Belford wrote:
>> Jim Thompson wrote:
>>>
>>> % awk -F \t '{printf("\"%s\" %s %s\n", $1, $2, $3)}' < itunes- 
>>> export-file
>>>
>>
>> I get this output in my terminal
>>
>> "Name" Artist Composer
>
> Jim's example prints fields 1, 2, and 3, but you want fields 1,
> 2, and 4.

Oops, Vince is right.

> I also had to tell awk to use a carriage-return as the
> newline instead of linefeed when reading in the file. My version
> with extraneous use of cat is:

Are you using Windows or something?

>   cat itunes-export-file \
>   | awk '{FS="\t";RS="\r";printf("\"%s\" %s %s\n", $1, $2, $4)}'
>
> Since XML was brought up, does anyone want to try some
> programming golf with their favorite language and XML library?

I pick (Common) Lisp and CL-XML

http://pws.prserv.net/James.Anderson/XML/




More information about the LUAU mailing list