LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-05-2006, 02:25 PM   #1
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Rep: Reputation: 30
I need help parsing text from a text file


Hello,

here is a snip of the file:

Installation Sources:
[x] SUSE LINUX Version 10.0 (http://172.20.10.160/suse10)
[x] (http://www.opensuse.org/YaST_package_repository)
[x] supplementary GNOME 2.12 update (ftp://ftp.suse.com//pub/suse/i386/su...0/yast-source/)
[x] guru (SUSE LINUX 10.0) (http://ftp.gwdg.de/pub/linux/misc/suser-guru/rpm/10.0)
[x] Packman (SuSE LINUX 10.0) (http://packman.unixheads.com/suse/10.0)
[x] scorot rpms (SUSE LINUX 10.0) (http://ftp.gwdg.de/pub/linux/misc/suser-scorot/suse100)
[x] suser-liviudm (SUSE LINUX 10.0) (http://ftp.gwdg.de/pub/linux/misc/suser-liviudm/10.0)
[x] usr-local-bin (SUSE LINUX 10.0) (http://ftp.gwdg.de/pub/linux/usr-local-bin/10.0)
[x] SUSE LINUX Version 10.0 (http://ftp.opensuse.org/pub/opensuse...SS/inst-source)

--snip--

i need to parse the url's from each line so the resulting file would look like this..

http://172.20.10.160/suse10
http://www.opensuse.org/YaST_package_repository
ftp://ftp.suse.com//pub/suse/i386/su...0/yast-source/
etc.
etc.
etc.


thanks for the help,

Ryan
 
Old 01-05-2006, 02:35 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
sed 's/\(.*(\(.*tp:.*\))\)/\2/g' file|grep "tp:/"

Should be close enough ;)



Cheers,
Tink
 
Old 01-05-2006, 02:43 PM   #3
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Original Poster
Rep: Reputation: 30
thanks!

Quote:
Originally Posted by Tinkster
sed 's/\(.*(\(.*tp:.*\))\)/\2/g' file|grep "tp:/"

Should be close enough



Cheers,
Tink

thank you sir!
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help parsing text file scilec Programming 5 12-02-2004 01:00 PM
need help parsing text file airman99 Linux - General 2 10-08-2004 09:09 PM
Parsing Text from a html file. Rezon Programming 6 10-18-2003 12:09 AM
Parsing a tab delimited text file jajanes Programming 9 08-08-2003 10:34 AM
Parsing a file for a string of text jamesmwlv Linux - General 2 12-02-2002 07:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration