![]() |
anyone good with sed?
im trying to grab all the links out of a chrome bookmark export file.
i want in the format of <a href="link">name</a> Code:
cat bookmarks_5_20_11.html | sed 's/^.*HREF="//' | sed 's/".*$//' |
Quote:
|
find /location/ -name "*.html" | xargs grep '<a href="link">name</a>'
|
Quote:
|
Quote:
|
Quote:
|
Google for command xargs and you should find proper example,saw tons of examples regarding what you looking for.
|
Your problem is one of regex... coming up with a solution now...
|
Fuck if i know, help me help you.
|
you could probably get exactly what you want in one line by using 'cut'
cut -f(whereverhereitis) -d\" (or whatever the encapsulating format is) file |
|
Code:
cat bookmarks_5_20_11.html |grep 'DT><A' | sed 's/\s*//'|sed 's/<DT>//' | sed 's/\s*ADD_DATE="[^"]*"//'| sed 's/\s*ICON="[^"]*"//' |
Quote:
anyway to trim the space at the end of the " > so its just <a href="link">test</a> instead of <a href="link" >test</a> :thumbsup |
Quote:
|
Quote:
ps got it working Code:
#!/usr/local/bin/bash |
Quote:
Code:
cat bookmarks.html | sed '/<DT><A\|<DT><H3/!d;s/<DT>//;/Bookmarks bar/d;s/ ADD_DATE=\".*\"//g;s/^[ \t]*//;s/<A HREF/<a href/' |
| All times are GMT -7. The time now is 09:25 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123