|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,426
|
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/".*$//'
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
|
|
|
|
#2 | |
|
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
Quote:
|
|
|
|
|
|
|
#3 |
|
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
find /location/ -name "*.html" | xargs grep '<a href="link">name</a>'
|
|
|
|
|
|
#5 |
|
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
|
|
|
|
|
|
#7 |
|
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
Google for command xargs and you should find proper example,saw tons of examples regarding what you looking for.
|
|
|
|
|
|
#8 |
|
Damn Right I Kiss Ass!
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,428
|
Your problem is one of regex... coming up with a solution now...
|
|
|
|
|
|
#9 |
|
So Fucking Banned
Industry Role:
Join Date: Jul 2010
Location: ☣
Posts: 9,327
|
Fuck if i know, help me help you.
|
|
|
|
|
|
#10 |
|
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
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
__________________
|
|
|
|
|
|
#11 |
|
So Fucking Banananananas
Industry Role:
Join Date: Mar 2003
Location: If I was in your ass you'd know it
Posts: 12,991
|
![]()
__________________
Email: Clicky on Me |
|
|
|
|
|
#12 |
|
Damn Right I Kiss Ass!
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,428
|
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="[^"]*"//' |
|
|
|
|
|
#13 | |
|
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,426
|
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>
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
|
|
|
|
|
#14 |
|
Confirmed User
Industry Role:
Join Date: May 2002
Location: Toronto
Posts: 8,475
|
|
|
|
|
|
|
#15 | |
|
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,426
|
Quote:
ps got it working Code:
#!/usr/local/bin/bash # chrome bookmark cleanup # converts bookmark export to just links with titles # our chrome bookmark export file cat bookmarks.html | \ # grep the links grep 'DT><A' | \ # remove the <DT> html tag sed 's/<DT>//' | \ # remove the DATE variable from the link sed 's/ ADD_DATE=\".*\"//g' | \ # remove the ICON variable from the link sed 's/ ICON=\".*\"//g' | \ # remove leading whitespace sed 's/^[ \t]*//' | \ # convert the html link tags to lowercase tr '<A HREF' '<a href'
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
|
|
|
|
|
#16 | |
|
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,426
|
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/'
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
|
|
|