10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi.. I have a file that has the following content :
abc 213 24 213
pqr 456#34 678
xyz 213 45%213
i need to write an awk script that will replace the second 213 in all the lines, if it is present. The IFS can not be specified and can be random.
The number of lines in the file and the... (5 Replies)
Discussion started by: Hermione Grange
2. Shell Programming and Scripting
I been following this forums since very long time.
I need to do one job.
In my script I am evaluating one variable, lets say n=100.
Now i have xml file inside which i need to replace the numbers in the desired lines with the evaluated number(n) +1.
For example let's say... (4 Replies)
Discussion started by: mailtosaiki
3. Shell Programming and Scripting
The question is not as simple as the title... I have a file, it looks like this
<string name="string2">Version 2.0</string>
I would like to check for duplicate entries of... (11 Replies)
Discussion started by: raidzero
4. Shell Programming and Scripting
How do I change the following date value with another value (while keeping the rest of the line) using sed? The date values can change so I need a general sed command to change the date value within the first quotation marks only.
Date values will be coming from 2 different files.... (2 Replies)
Discussion started by: pchang
5. Shell Programming and Scripting
I'm trying to figure out a way to replace newlines after a unique string is read, all the way until that string occurs again.
The input file looks something like this:
02/11/11 22:48:00 This is the first line
This is the second line
This is the third line
02/11/11 22:49:00 This is the... (8 Replies)
Discussion started by: acruhl
6. Shell Programming and Scripting
Simple question - I am trying to use sed to replace two different strings. As it stands I can implement this as:
sed -i 's/TIMEOUT//g'
sed -i 's/null//g'
And it works. However, is it possible to shrink that down into a single command? Will there be any performance benefits? (3 Replies)
Discussion started by: msarro
7. Shell Programming and Scripting
I just need to do find and replace in a file....
say for eg I have the input file like below:
I need to replace oldtext to newtext... my output file should come like below..
out.txt... (9 Replies)
Discussion started by: askumarece
8. UNIX for Dummies Questions & Answers
Hello Can Any1 help me.
I want to replace a specific character string inside a file at a specific location with a particular character with the help of a command or a shell script.
The tr command replaces a specific character with another for all the occurences of that character in the file.
I... (5 Replies)
Discussion started by: rahulrathod
9. Shell Programming and Scripting
how do i replace a string within two strings ?. i have a string called my_string i.e
i need to replace all characters between DAT and SLTZ with zeros, the number of characters between these strings might vary .
... (1 Reply)
Discussion started by: amit1_x
10. Shell Programming and Scripting
I want to change the following
passwd: files nis
group: files nis
passwd: files compat
group: files compat
cp -p nsswitch.conf nsswitch.conf.old (3 Replies)
Discussion started by: melanie_pfefer