Filtering Text, help really needed.

Discussion in 'macOS' started by Eazkk123, Nov 25, 2008.

  1. Eazkk123 macrumors member

    Joined:
    Jan 17, 2007
    #1
    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>
     
  2. Eazkk123 thread starter macrumors member

    Joined:
    Jan 17, 2007
  3. belvdr macrumors 601

    Joined:
    Aug 15, 2005
    #3
    In Terminal:
    Code:
    egrep '<string>http://' <your filename> | cut -d\> -f2 | cut -d\< -f1 > your_new_file.html
     

Share This Page