Results 1 to 2 of 2
Hi,
I'm very new to writing script files and I was wondering how I would go about creating a simple script file that would edit another input file. What I ...
- 08-21-2008 #1Just Joined!
- Join Date
- Aug 2008
- Posts
- 1
Newbie question- how do i write a script file to edit another file
Hi,
I'm very new to writing script files and I was wondering how I would go about creating a simple script file that would edit another input file. What I have in the input file are geometry locations, but I need to add a negative sign to all the x locations.
"point 0.123 0.456" (a thousand of these "points")
needs to be
"point -0.123 0.456"
There is some other text throughout the file, but this is all i need to do. I'm running a bash shell in fedora.
Thanks
- 08-22-2008 #2Linux User
- Join Date
- May 2008
- Location
- NYC, moved from KS & MO
- Posts
- 251
Try
Code:awk '/^point/ {print $1,"-"$2,$3}' your_input_file > output_file


Reply With Quote