• 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
Re: Piping sed to sed commands
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Piping sed to sed commands


  • Subject: Re: Piping sed to sed commands
  • From: Gnarlodious <email@hidden>
  • Date: Sat, 17 Jan 2004 08:30:21 -0700

Thank you Terry for taking the time to explain it to me. I'm starting to see
the power of Regex based on a real project for the first time.
You can see the work in progress here:
<http://www.Gnarlodious.com/Workshop/AppleScript/iTunes-iPage.html>

If you peek at the source of this page that9s the output I'm looking for.
http://www.Gnarlodious.com/iTunes.html

Entity BJ Terry spoke thus:

> If you really just need Artist and Name, you can do it like this:
do shell script ,
"sed 's/.*<key>Name<\\/key><string>\\(.*\\)<\\/string>/<td
class=Name>\\1/' " & inPOSIX & ,
" | sed 's/.*<key>Artist<\\/key><string>\\(.*\\)<\\/string>/<td
class=Artist>\\1/' " & ">" & outPOSIX *)

Apple continually adds new elements to iTunes' database, but I only want 7
of them:
Name Artist Album Genre Size Year Comments

Is there a way in sed/regex to only print these lines dropping the rest? If
not, I can use your above solution piping 7 commands together, but it seems
like a kludge.

> I put quotes around the classes
> too, I'm not sure if that is necessary
No, it's not in modern browsers, and neither
is the closing tag for cells "</td>".

-- Gnarlie

>> <key>Track ID</key><integer>456</integer>
>> <key>Name</key><string>Rock Me Right</string>
>> <key>Artist</key><string>Susan Tedeschi</string>
>> <key>Album</key><string>Just Won't Burn</string>
>> <key>Genre</key><string>Rock Blues</string>
>> <key>Kind</key><string>AAC audio file</string>
_______________________________________________
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: Piping sed to sed commands
      • From: BJ Terry <email@hidden>
References: 
 >Re: Piping sed to sed commands (From: BJ Terry <email@hidden>)

  • Prev by Date: Re: First time script ... help for debugging
  • Next by Date: Re: Inheritance
  • Previous by thread: Re: Piping sed to sed commands
  • Next by thread: Re: Piping sed to sed commands
  • Index(es):
    • Date
    • Thread