LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-10-2004, 03:58 AM   #1
BigLarry
LQ Newbie
 
Registered: Jun 2004
Posts: 5

Rep: Reputation: 0
Problem with SED and blank spaces


New to this so go easy on me

I use wget to grab a file from the net and output it to foo.txt

i then use sed to strip out html tags and then another to remove tabs from the file so I end up with something like this:

06:05

CIENCIA FICCIÓN

Ladrones de identidad: La parte más noble del valor

06:50

CIENCIA FICCIÓN

Expediente X: Nuestra ciudad

As you see there are unwanted blank lines in the file (foo.txt)

Using sed and awk i've tried in vain to remove these but it just won't do it.

Strange thing - if i open foo.txt in a text editor and make a small change then save it THEN run sed to remove the blank lines, it does it perfectly!!

Any help is appreciated.

Larry
 
Old 06-10-2004, 04:42 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You might want to look at the file in the hexedit program. The last part of your message seems to indicate the the files you are working with use both RET and NL characters to end a line. The text editor changes that either when loading in the file or when saving it.
 
Old 06-10-2004, 04:57 AM   #3
BigLarry
LQ Newbie
 
Registered: Jun 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the reply.

I've just installed tofrods and that sorts the problem!!

HUZZAH!!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
file name spaces problem hesher Linux - Software 2 03-06-2005 11:12 AM
Insert character into a line with sed? & variables in sed? jago25_98 Programming 5 03-11-2004 06:12 AM
mp3 files - replacing blank spaces with _ script? mymojo Linux - Newbie 4 12-08-2003 03:33 AM
BASH scripting problem, spaces in filenames / using basename textures Programming 24 11-16-2003 01:41 AM
Problem with ncurses and spaces joeuser Programming 1 12-21-2002 01:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:55 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