• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Multiline awk needs debugging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Multiline awk needs debugging
      • From: Chap Harrison <email@hidden>
  • Prev by Date: Does UI scripting work on MacOSX 10.2?
  • Next by Date: Re: Does UI scripting work on MacOSX 10.2?
  • Previous by thread: Re: Does UI scripting work on MacOSX 10.2?
  • Next by thread: Re: Multiline awk needs debugging
  • Index(es):
    • Date
    • Thread