If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Change Unwanted Data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-09-04, 09:52
malinut89 malinut89 is offline
Registered User
 
Join Date: Jan 2004
Posts: 4
Change Unwanted Data

Hi,

I'm looking for a shell script to change certain data points from my text file to something useable. All of the points that I would like to remove have the value -998.00. I need to find a command that will change the values of -998.00 to 0.00 without opening the file in a text processor. What could I type to change the values and make a new file named something.dat? Thank you!
Reply With Quote
  #2 (permalink)  
Old 02-09-04, 11:08
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
Quote:
sed 's/-998\.00/0.00/g' input_file > temp_file
mv temp_file input_file
or, for the same result

Quote:
perl -pi -e '/-998\.00/0.00/g' input_file
__________________
Jean-Pierre.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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