Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Eazkk123

macrumors member
Original poster
Jan 17, 2007
62
0
Below is a snippet of the code I need to filter. I would like to remove all the coding and just be left with the URLs in a list with no spacing in between. Then import it into Firefox as a .html file. All the URLs in this file start with http.

Can this be done using a script or is there another way of doing this? :confused:


Code:
	<key>WebHistoryDates</key>
	<array>
		<dict>
			<key></key>
			<string>http://support.apple.com/kb/TA24670?viewlocale=en_US</string>
			<key>lastVisitedDate</key>
			<string>249328260.6</string>
			<key>title</key>
			<string>Mac OS X 10.4: Reading .plist preference files</string>
			<key>visitCount</key>
			<integer>1</integer>
		</dict>
		<dict>
			<key></key>
			<string>http://forum.insanelymac.com/lofiversion/index.php/t102510.html</string>
			<key>lastVisitedDate</key>
			<string>249328251.1</string>
			<key>title</key>
			<string>InsanelyMac Forum > Trying to convert my plist with video and audio strings to hex = "Bus error"</string>
			<key>visitCount</key>
			<integer>1</integer>
		</dict>
		<dict>
			<key></key>
			<string>http://www.macosxhints.com/article.php?story=20050430105126392&query=filenames</string>
			<key>lastVisitedDate</key>
			<string>249328250.4</string>
			<key>title</key>
			<string>macosxhints.com - 10.4: Convert new plist files between XML and binary</string>
			<key>visitCount</key>
			<integer>1</integer>
		</dict>
		<dict>
			<key></key>
			<string>http://codesnippets.joyent.com/posts/show/749</string>
			<key>lastVisitedDate</key>
			<string>249328242.1</string>
			<key>title</key>
			<string>CodeSnippets: Convert plist files from binary to xml and back again [osx] [terminal]</string>
			<key>visitCount</key>
			<integer>1</integer>
 
Yes, there is. For example you can just make a shell script calling "grep" to give you all the lines you want (with http) and "cut" to remove all the crapy html tags.

Take a look at the Bash Programming guide at:

http://tldp.org/LDP/Bash-Beginners-Guide/html

Ivan

PS: Of course this is not the only way of doing it. Perhaps Automator can be easier to use.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.