Multiline awk needs debugging
Multiline awk needs debugging
- Subject: Multiline awk needs debugging
- From: Gnarlodious <email@hidden>
- Date: Mon, 26 Jan 2004 00:54:59 -0700
I don't know if I'm escaping this wrong or it's written wrong, can some
expert help get this debugged? I don't know a thing about awk, and don't
even know how to run it in Terminal.
do shell script "awk -F'>' 'NR==1 { print \"<tr>\"; next }
function p(name) {
print \"<td class=\" name \">\" saved[name]
saved[name]=\"\"
}
/^<tr>/ {
p(\"Name\")
p(\"Album\")
p(\"Genre\")
p(\"Size\")
p(\"Year\")
p(\"Comments\")
print \"<tr>\"
next
}
{ key=$1; gsub(/.*=/,\"\",key); saved[key]=$2 }' $@ " & inPOSIX & ">" &
outPOSIX
Should loop through a fie inserting missing cells in place.
You can easily download the test script:
http://home.earthlink.net/~gnarlodious/iTunesTest.scpt.sit
-- Gnarlie
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.