LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-19-2010, 03:47 PM   #1
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Rep: Reputation: 40
How to remove over written lines


Hi group,
I need to filter the log from a massive wget. I want to remove the progress lines and only leave the last one. Now each progress line starts with a newline '\r'. Would awk be a good choice for this??

Thanks for your time.
 
Old 04-19-2010, 04:52 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
The '\r' - or hex D - actually represents a carriage return. (Newline is represented by '\n', or hex A.)

Yes, this can be done using awk. May I ask why each progress line starts with a carriage return..? It seems very odd that wget would insert such a thing.
 
Old 04-19-2010, 04:58 PM   #3
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
It might be worth posting a condensed version of your file here so that people can see exactly what you are working with.
 
  


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
How to remove lines and parts of lines from python strings? golmschenk Programming 3 11-26-2009 11:29 PM
How do I remove lines that have more than one of a certain character in them? SentralOrigin Linux - General 2 01-14-2009 01:40 PM
How to remove the first part of lines? daYz Linux - Software 3 11-26-2005 06:09 PM
How to remove lines from a file doza Linux - General 2 04-27-2005 11:59 AM
how to remove all commented lines win32sux Linux - General 11 05-08-2004 03:27 AM

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

All times are GMT -5. The time now is 12:05 AM.

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