10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello, I am trying to insert a section of text between lines in another text file.
The new lines to be inserted are:
abcd.efgh.zzzz=blah
abcd.efgh.xxxx=blah
Where N = 0 to 2
Original File:
abcd.efgh.wwxx=aaaaa
abcd.efgh.yyzz=bbbbb
abcd.efgh.wwxx=aaaaa
abcd.efgh.yyzz=bbbbb... (3 Replies)
Discussion started by: tsu3000
3 Replies
2. Shell Programming and Scripting
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
3. Shell Programming and Scripting
I have a text file with records of the form:
A X1 Y1 X2 Y2 X3 Y3
where A is character length 10, Xi is character length 4 and Yi is numeric length 10.
I want to parse the line, and output records like:
A X1 Y1
A X2 Y2
A X3 Y3
etc
Can anyone please give me an idea of how to do this. ... (4 Replies)
Discussion started by: wvdeijk
4 Replies
4. Shell Programming and Scripting
Hi,
I want to insert the text 'Unknown' in 2 specific columns in a csv file (actually | separated) if the column is blank. Its always the same columns.
I have tried using sed: sed "s/||/|Unknown|/g"
but there are occasion where other fields are blank and they need to be left blank. This... (4 Replies)
Discussion started by: ksexton
4 Replies
5. Shell Programming and Scripting
Hi,
Input- a file comtaining a procedure or function with various statements in that one of the statement would be
insert into table1 (a,b,c) values (1,2,3)
ourput required
true if insert statement is using column name (a,b,c) else false.
Please suggest (8 Replies)
Discussion started by: manasa_vs
8 Replies
6. Shell Programming and Scripting
I have done this sed command to insert one line after a specific string is found:
sed '/patternstring/ a\
new line string' file1
But how do I insert two lines? This is not possible:
sed '/patternstring/ a\
new line string \a
new line string 2' file1 (2 Replies)
Discussion started by: locoroco
2 Replies
7. Shell Programming and Scripting
I'm trying to use sed to insert data at a specific column, let's say my data looks like this:
0553 1828
0552 1829
0550 1829
0549 1830
0548 1831
what I want is this:
timein 0553 timeout 1828
timein 0552 timeout 1829
timein 0550 timeout 1829
timein 0549 timeout 1830
timein 0548... (5 Replies)
Discussion started by: mswartz
5 Replies
8. Shell Programming and Scripting
Hi all
I've been working on a bash script parsing through debug/trace files and extracting all lines that relate to some search string. So far, it works pretty well. However, I am challenged by one requirement that is still open.
What I want to do:
1) parse through a file and identify all... (3 Replies)
Discussion started by: reminder
3 Replies
9. Shell Programming and Scripting
I'm attempting to insert multiple lines before a line matching a given search pattern. These lines are generated in a separate function and can either be piped in as stdout or read from a temporary file.
I've been able to insert the lines from a file after the pattern using:
sed -i '/pattern/... (2 Replies)
Discussion started by: zksailor534
2 Replies
10. Shell Programming and Scripting
Hi all,
I've got some problems with editing a big configuration file .. its about 2k lines long.. anyway what I need is to place certain text to certain line number.. lets say I need to place "Something" on line 980 .. "something" else on line number 1500 and so on without tempering the rest of... (12 Replies)
Discussion started by: c0mrade
12 Replies