Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 4th October 2011, 02:13
kiza kiza is offline
Junior Member
Join Date: Oct 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default terminal split one line file by regex


I wanted to create a custom made scrolling gallery on ebay for my store, however I didn't want another logo and links plastered over it like some scrub so I wanted to pull the listing off a seller aka me from the ebay store and split the file by the links to items and link to it later

However i have been trying many regex expressions with grep and awk and i have realized, i really suck.

Everything i try with awk and grep splits from the start of the newline which is nearly the entire page, any help is greatly appreciated, i have been using curl to get the source code for manipulation or you could just view source and check it out

my latest attempt was:
curl www.ebay.com.au/sch/orangeit_store/m.html?_dmd=1 | awk '/Featured Items/,EOF'

the website is a search request by a seller id and the awk was trying to remove the junk at the start so i would only get the results, after this i was hoping to either place newlines at the start of <a tags or split by items

I answered my own question, i was trying to do advanced stuff when i thought of a simple solution:

sed "s/</\n</g"
which just finds all opening tags and replaces it with a newline and puts back in the opening tag, i am sure there are much more elegant solutions, but this sets up for easy grep commands which is what i need =]

Last edited by kiza; 4th October 2011 at 03:52. Reason: SOLVED
Reply With Quote
Sponsored Links


file, regex, splitting, terminal

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
All my mail is going to /var/mail/vmail _sluimers_ Installation/Configuration 21 10th January 2011 14:21
Hacked server Captain Installation/Configuration 8 23rd December 2010 11:39
Being Spammed/Hacked/Probed not sure PLEASE HELP! kresser General 10 29th October 2010 18:25
libWand.so.10 error Taxick Installation/Configuration 8 3rd May 2009 02:27
Spamsnake - Problem with spamassassin, FuzzyOcr and MySQL debuguser HOWTO-Related Questions 6 16th September 2008 19:37

All times are GMT +2. The time now is 06:52.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.