[LUAU] not using SED to extract song, artist, and album from my iTunes Music List Export
Vince Hoang
vince at litrium.com
Thu Sep 28 02:54:03 PDT 2006
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. 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:
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?
-Vince
More information about the LUAU
mailing list