Results 1 to 3 of 3
Hello Linux Forums,
I recently made the switch from Windows 7 to Ubuntu 10.10. I'm trying to get used to doing some scripting and so I'm trying to extract uri's ...
- 01-31-2011 #1Just Joined!
- Join Date
- Jan 2011
- Posts
- 4
[Help Request] Extracting uri's from mozilla bookmarks backup
Hello Linux Forums,
I recently made the switch from Windows 7 to Ubuntu 10.10. I'm trying to get used to doing some scripting and so I'm trying to extract uri's from firefox backup file.
I can't post what the file contains because I'm not allowed to post urls without making 15 posts first.
I suppose the relevant information is that they begin with http and end at the next "}".
I think I need to pipe cat into grep and then use cut to select the fields.
Something like:
needless to say this doesn't work.Code:cat bookmarks.json | grep "http" | cut -d } -f 1
Can anyone point me in the right direction?
Much appreciated.
-T
- 01-31-2011 #2
Your syntax is right!
But i suppose the bookmark backup is a single line file, thats why grep doesnt work.
You can try,
Here the commas are converted to newline and the lines with http are taken and just urls filtered.cat bookmarks.json | sed 's/\,/\n/g' | grep http | cut -d\" -f4 > new.json
Let me know if it went well
- 02-02-2011 #3Just Joined!
- Join Date
- Jan 2011
- Posts
- 4
Worked perfect thanks!!


Reply With Quote