LinuxQuestions.org
Help answer threads with 0 replies.
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
 
LinkBack Search this Thread
Old 10-24-2006, 01:48 AM   #1
tmaxx
LQ Newbie
 
Registered: Jun 2006
Posts: 21

Rep: Reputation: 15
Removing "#" character in a huge txt file


hi

does anyone have a sed script which removes leading # character in a huge txt file
example:

#92023424
#98498934
#38438438
342342342
342342323
342342434

thanks
 
Old 10-24-2006, 01:56 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 9,599

Rep: Reputation: 1000Reputation: 1000Reputation: 1000Reputation: 1000Reputation: 1000Reputation: 1000Reputation: 1000Reputation: 1000
Code:
sed 's/#//' huge.txt> huge-new.txt
 
Old 10-24-2006, 01:57 AM   #3
bmintern
LQ Newbie
 
Registered: Oct 2006
Posts: 5

Rep: Reputation: 0
sed s/^#//

Edit: Whoops, beat me to it, but do note that if you only want to remove leading #'s you will want the ^ in there. Otherwise, something like this:

stuff # comment about that stuff

will be replaced with:

stuff comment about that stuff

which may cause problems by whatever is reading this file.

Last edited by bmintern; 10-24-2006 at 02:03 AM.
 
Old 10-24-2006, 03:04 AM   #4
tmaxx
LQ Newbie
 
Registered: Jun 2006
Posts: 21

Original Poster
Rep: Reputation: 15
thanks for the help guys
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
removing first "0" or "63" in a text file tmaxx Linux - General 5 07-10-2006 08:08 AM
Huge log file grow since "yum update" on 29 April cubensys Fedora 1 05-21-2006 06:34 AM
where is "installed-chrome.txt" file in firefox 1.5 ?? tuxfood Linux - Software 1 12-21-2005 12:44 PM
Creating a file like "DATE.txt" parker Programming 4 03-10-2004 04:44 AM
Removing "shutdown" and "reboot" in logout window nearfar Red Hat 1 10-07-2003 11:33 AM


All times are GMT -5. The time now is 07:53 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration