This is true, so if that isn't available I would use ed.
This is a pretty simple example and you can loop through your target files. The reason for the two search fields in the above example is so you can search for something on a line and then search/replace something else on that particular line. Much more detail in Ch25 of Amazon.com: Expert Shell Scripting (Expert's Voice in Open Source): Ron Peters: Books
This is true, so if that isn't available I would use ed.
This is a pretty simple example and you can loop through your target files. The reason for the two search fields in the above example is so you can search for something on a line and then search/replace something else on that particular line. Much more detail in Ch25 of Amazon.com: Expert Shell Scripting (Expert's Voice in Open Source): Ron Peters: Books
whats wrong with this code..please
i have two text files in which i have 'see' and i want to make it 'saw'
the scripts executes fine but i dont see any replacement done.
Thanks
Last edited by vgersh99; 07-22-2009 at 03:57 PM..
Reason: code tags, PLEASE!
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
Thank You.
The UNIX and Linux Forums
---------- Post updated at 03:01 PM ---------- Previous update was at 02:57 PM ----------
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
Thank You.
The UNIX and Linux Forums
---------- Post updated at 03:01 PM ---------- Previous update was at 02:57 PM ----------
Even this was not successful
onetest.sh
r1.txt r2.txt
Substitute pattern match failed
r1.txt
Substitute pattern match failed
r2.txt
Substitute pattern match failed
This is a smallpart of my input file.I want to change the ID values of entries having CMW as an entry.
Cont_1.266 . CMW 2958 3269 . - 0 PARENT=t:UM06506T0;ID=UM06506P0;rank=6
Cont_1.266 . CMW 3394 3505 . - 0 ... (3 Replies)
#!/bin/bash
#
name=$1
type=$2
number=1
for file in ./**
do
if
then
filenumber=00$number
elif
then
filenumber=0$number
fi
tempname="$name""$filenumber"."$type"
if (4 Replies)
hello,
i have a problem.
suppose
file.txt
i want to add lines over those lines in a file if it starts and ends with how and "?" respectively.
i want output like
output
file.txt
thanks (4 Replies)
I am working in C and need a solution for below problem:
I have a binary file, which needs to be edited in such a way no data is loss.
For example i have to insert 3 bytes of data at some position without changing the contents of the file.
if file has data as:... (2 Replies)
Hi All,
I have a folder that contains 100's of files and each file have a similar content like the following format:
((STBJa:200.0,((STBTz:200.0,(STSwe:200.0,(STDUw:200.0,(ST4Bu:200.0,STL2b:200.0):127.0):86.0):80.0):120.0,
STAHr:200.0):134.0):200.0,STuNg:200.0);What I need is to do is add "#1"... (2 Replies)
hi guys,
We have to implement new local (/etc/default/login) USER security policy on almost 50 stations.
so editing /etc/default/login and /etc/default/passwd will be way too long work.
Can we do the same using some script, I mean editing the above files and putting variables as RETRIES=3, ... (5 Replies)
I attempted to change the IP of my Solaris 9 box by changing these files:
/etc/hosts
/etc/hostname.dmfe0
And when I rebooted my system, the changes did not come up through the reboots. I have searched high and low and this is how you change the IP address permanently. Can anyone tell me what... (2 Replies)
:(
what is the best way of editing the various .plist files without adding third party files? Or is the easiest way is to add third party applications, which ones? please kept in mind that i am not a programmer.
mike (1 Reply)
hi i would like to know whether i can delete a part of a file in C
for eg. if my file contained
1234567890
and i want to delete
456
so that it becomes
1237890
is there a way i can do this.
well, one way i can achieve this is by creating a new file, copy whatever i want, then... (2 Replies)
i currently am using a unix server and NT pc. i have downloaded a ziped file that should explode into 3 seperate unix based files, however when i unzip it using Alading Expander it displays only 1. This exploded version contains all 3 files ( you can scroll down when viewing the file and see the... (1 Reply)