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
5 Replies
2. Shell Programming and Scripting
Hello members,
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
4 Replies
3. Shell Programming and Scripting
The question is not as simple as the title... I have a file, it looks like this
<string name="string1">RZ-LED</string>
<string name="string2">2.0</string>
<string name="string2">Version 2.0</string>
<string name="string3">BP</string>
I would like to check for duplicate entries of... (11 Replies)
Discussion started by: raidzero
11 Replies
4. Shell Programming and Scripting
Hi forum.
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
2 Replies
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
8 Replies
6. Shell Programming and Scripting
Hey everyone!
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
3 Replies
7. Shell Programming and Scripting
Hi All,
I just need to do find and replace in a file....
say for eg I have the input file like below:
in.txt
#####
oldtextoldtext
oldtext
oldtext
oldtext
oldtext123
oldtext-
oldtext
I need to replace oldtext to newtext... my output file should come like below..
out.txt... (9 Replies)
Discussion started by: askumarece
9 Replies
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
5 Replies
9. Shell Programming and Scripting
how do i replace a string within two strings ?. i have a string called my_string i.e
my_string="GACAHX04GAC010000000001DDELTA 0001DAT00001320SLTZ"
i need to replace all characters between DAT and SLTZ with zeros, the number of characters between these strings might vary .
i.e
output
... (1 Reply)
Discussion started by: amit1_x
1 Replies
10. Shell Programming and Scripting
Hi
I want to change the following
passwd: files nis
group: files nis
in /etc/nsswitch.conf
to be
passwd: files compat
group: files compat
I tried
cp -p nsswitch.conf nsswitch.conf.old (3 Replies)
Discussion started by: melanie_pfefer
3 Replies