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.
My server xml file has huge data part of which i'm sharing below.
I wish to add the below text held by variable "addthisline" after the closing braces i.e --> once the first </Connector> tag is found.
addthisline="I need to be inserted after the comments"
Thus my searchstring is... (3 Replies)
Hi All,
I am using UNix Sun OS sun4u sparc SUNW,SPARC-Enterprise
My intention is to insert a line of text after 13th line of every file inside a particular directory.
While trying to do it for a single file , i am using sed
sed '3 i this is the 4th line' filename
sed: command garbled: 3... (5 Replies)
I have a test file that I want to read and insert only certain lines into the
the table based on a filter.
1. Rread the log file 12 Hours back Getdate() -12 Hours
2. Extract the following information on for lines that say "DUMP is
complete"
A. Date
B. Database Name
C.... (2 Replies)
sed '1r file.txt' <source.txt >desti.txt
This example will insert 'file.txt' between line 1 and 2 of source.txt.
sed '0r file.txt' <source.txt >desti.txt
gives an error message.
Does anyone know how 'sed' can insert 'file.txt' before the first line of source.txt? (18 Replies)
Hi
I need to update a number of existing files and insert #!/bin/ksh line a the first line of the file.
Is there any awk or sed command which would help me to do that instead of doing it manually?
Thanks a lot -A (10 Replies)
Dear Folks :),
I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp.
I can do this in vi editor by using this command :g/^/s//BBB_
e,g I have a file named as Test.dat and it containins below text:
michal... (4 Replies)
So I need to write lines into line X of file X.
I can get the file by doing:
cfgnumber=$(cat -n -comm.cfg| grep -i "servicegroup_name 24x7-comunicacions")
echo $cfgnumber
it outputs the Line where it finds now I need to start writing something right bellow that line.
thanks (10 Replies)
I need to insert a file called temp_impact (which has about 15 lines in it) to a file called 11.23cfg starting at line 33. I searched the forums and found the
sed '34i\
test' 11.23cfg > newfile
That will enter word test at the appropriate line, but i need the entire file dumped there. Any... (4 Replies)
Hi folks,
I have the following program:
#! /bin/ksh
set -xv
export grepDataSource="</data-sources>"
export DB_HOST=tornado
export SCHEMA_NAME=IAS10G
export dataSource=data-sources.xml
sourceString="<data-source class=\"oracle.jdbc.pool.OracleConnectionCacheImpl\" name=\"RiGHTvDS\"... (7 Replies)