The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
replacing characters infyanurag Shell Programming and Scripting 3 05-20-2008 10:55 PM
replacing the characters in a file trichyselva UNIX for Dummies Questions & Answers 2 01-03-2008 04:02 AM
Help Replacing Characters in Flat File nelson553011 Shell Programming and Scripting 8 05-17-2007 08:57 AM
Replacing characters in file with line break johnemb Shell Programming and Scripting 10 04-26-2007 04:38 AM
replacing few characters in a file purnakarthik UNIX for Dummies Questions & Answers 1 01-25-2007 01:17 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-30-2008
Registered User
 

Join Date: Mar 2008
Posts: 1
Replacing characters in csv file

Hello all,
This is my first post here, so please excuse me if this question is too obvious or has been asked before. I am new to Unix and although I tried to search your forum for the answer to my question, I could not find an answer that would help me.
I have a 500MB csv file with numeric values as percentages, i.e., 6.56%, or (4.35%). I need to replace the "%" with an empty character, the ")" also with an empty character, and the "(" with a "-" sign. Can someone point me to the right command in unix to do this? Standard Mac text editors blow up because of the size of the file.
Thanks a lot for your help!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-31-2008
Tytalus's Avatar
Registered User
 

Join Date: Jun 2003
Location: Scotland
Posts: 218
Code:
#  echo "6.56%, or (4.35%)." | sed 's/[\%\)]//g;s/(/-/g'
6.56, or -4.35.
HTH
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0