Hi I'm new to sed, and need to add characters into a specific location of a file, the fileds are tab seperated.
text <tab> <tab> text <tab> text EOL
I need to add more characters to the line to look like this:
text <tab> <tab> newtext <tab> text <tab> text EOL
Any ideas? (2 Replies)
please help in making sed singleline command
i need to insert dos new line (CR LF) before
" 34 matching device(s) found on \\cpu1."
" 6 matching device(s) found on \\cpu7."
" 102 matching device(s) found on \\mainserver."
the problem is that sometimes there are both CR LF before strings and... (1 Reply)
Hi,
I have to insert a line having variables using sed. But the variables are not getting substituted within sed.
Ex:
n=2
sed $n' i\
hi' file
This works. But the below code does not work.
n=2
line=hello
sed $n' i\
$line' file
The above code inserts '$line' in the 2nd line of the... (9 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 Guys,
can any one know how to replace the string by newline using sed ?
i dont need any other solution. I am very curious to know this in sed.
Input:
one,two,three
Output
one
two
three
we can acheive this by awk but in sed ?,
awk '{gsub(/\,/,"\n");print;}' File (6 Replies)
Hi all,
I have a file called "text.cpp" with the first line of "1"
afterwards I tried in Ubuntu to type the following
sed '12iasdasdasdasdsad' test.cpp > output.txt
however when I tried to see the result of output.txt
#cat output.txt
1
why is the line 12 is not updated to the... (6 Replies)
Hello.
I have a config file (/etc/my_config_file) which may content :
#
# port for HTTP (descriptions, SOAP, media transfer) traffic
port=8200
# network interfaces to serve, comma delimited
network_interface=eth0
# set this to the directory you want scanned.
# * if have multiple... (6 Replies)
Hi
I am trying to run a sed command within a script..unfortunately it wasn't written on Solaris so doesn't work. Can anyone help with the correct coding please?
It is:
sed -i '1i ROWID;ORDER_ID;JOB_NAME;ORDER_TABLE' ${OUTFILE} (4 Replies)