10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi ,
i have a file with data as below.This is same file. But actual file contains to many rows.
i want to search for a string "Field 039 00" and delete that line and previous 3 lines in that file.. Can some body suggested me how can i do using either sed or awk command ?
Field 004... (7 Replies)
Discussion started by: vadlamudy
7 Replies
2. Shell Programming and Scripting
I am working on a script to convert bank data to a csv file. I have the format done - columns etc. The final piece of the puzzle is to change the second field (after the R) of every line to reflect its' line number in the file. I am stumped. I can use awk on each line but need help looping through... (9 Replies)
Discussion started by: Melah Gindi
9 Replies
3. Shell Programming and Scripting
Hi,
I need to search for source path in file2 , as per file1 and if found get the next line and take the field value and put it in URL value of file1.
In file1, NF is not same for all the lines.
file1:
<type source="/home/USER/Desktop" Dest="/home/USER/DIR1/Desktop" URL="ssh/path"/>
<type... (8 Replies)
Discussion started by: greet_sed
8 Replies
4. Shell Programming and Scripting
i have something like this,
cat filename.txt
hui this si s"dfgdfg" omeone ipaddress="10.19.123.104" wel hope this works
i want to replace only 10.19.123.104 with different ip say 10.19.123.103
i tried this
sed -i "s/'ipaddress'/'ipaddress=10.19.123.103'/g" filename.txt
... (1 Reply)
Discussion started by: vivek d r
1 Replies
5. Shell Programming and Scripting
Hi Guys
I have the following file
Essentially, I am trying to find the right awk/sed syntax in order to produce the following 3 distinct files from the file above:
Basically, I want to print the lines of the file as long as the second field of the current line is equal to the... (9 Replies)
Discussion started by: moutaye
9 Replies
6. Shell Programming and Scripting
I need to read the contents of a file. Then I need to grep for a keyword and replace part of the grepped line based on the condition of previous and present line.
Example input file:
V {
port1 = P;
port2 = 0;
shift_port = P0; /* if next shift_port is P0 I need... (9 Replies)
Discussion started by: naveen@
9 Replies
7. Shell Programming and Scripting
plz help me!!
I have this file ,
3408 5600
3796 6035
4200 6285
4676 0
40 1554
200 1998
652 2451
864 2728
1200 0
I want it like if $2==0,replace it with field from the previous line+500
say here the o/p would be like
3408 5600
3796 6035
4200 6285... (16 Replies)
Discussion started by: Indra2011
16 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
I'm writing a script in bash where i'm reading line by line into variable,
and the i want to replace the second filed in the line with another number,
for example if the line looks like this:
10 20 30 40 50
it should look like this:
10 90 30 40 50
and put the new result inside... (1 Reply)
Discussion started by: morfix
1 Replies
9. UNIX for Dummies Questions & Answers
I have a file 'test.out' with contents:
1|1|10|10|I|asdf|
2|1|10|10|I|sdfg|
4|1|10|10|I|hgfj|
34|0|10|10|I|sdg|
I want to modify the fifth column with value 'I' to 'A' for only the last line. Below is what I expect to see:
1|1|10|10|I|asdf|
2|1|10|10|I|sdfg|
... (3 Replies)
Discussion started by: ChicagoBlues
3 Replies
10. Shell Programming and Scripting
Hi ,suppose I have a file
title=dsafsadf
........
.......
year=1995
author=john smith
............
title=bbbbbb
........
.......
year=1988
author=alex
I need to replace the title line with a expression that contains variables year and author. I want to use a python readline for loop.... (10 Replies)
Discussion started by: grossgermany
10 Replies