I have a source text file that contains something like this:
Following is used to remove this template from source file.
I can then display the template in all its true glory with crlf.
Now I want to replace <var_name> with 'hello'
Works but all the CRLF's seem to have been removed!
Ok, so lets not do the replace, but just write the un modified template to another file
after a particular line that contains say 'insert after this line'
Checking target_file.txt, the template has been inserted in the correct place but again cr/lf have been removed.
I'm kind of using this to learn sed as well as write a small utility for my one use. I hate giving up and I'm sure it can be done.
Anyone have any idea how I can keep cr/lf when I do the replace and the write
to the new file?
thanks in advance.
Last edited by Franklin52; 11-05-2010 at 01:05 PM..
Reason: Please use code tags
Hi,
I would like to change some lines in my mysql-dump, because there a syntax problems with some version of mysql.
I 'd like to change
USE ´someDatabase´;
to
USE someDatabase;
(without backticks) using the sed command in the shell
Thanks & best regards
Bernd (5 Replies)
HI All,
Have some files which contains some string like,
"create .<table1> as"
"insert into .<table2> values",
i want to replace ".<table1>" with only "<table1>", i.e removing '.' character in ksh, i have written below code but it is not removing the dot character, any help?
for name... (2 Replies)
Hi,
I have a file with the text below. How do i remove the character "%" from the text file using sed ? Can anybody help ?
0%
68%
72%
0%
54%
33%
75%
24%
6%
59%
77%
77%
33% (6 Replies)
Hi Experts,
I have a syslog file from 1000's of different hosts which I want to adjust by removing the domain suffix from the hosts.
My previous attempts haven't managed to match all the different lenghts of the subdomains which are being logged.
Could somebody suggest which sed syntax... (6 Replies)
Hello Friends, How can I remove the last two values of this line using sed
John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638:9/3/90:45900
The result should look like this:
John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638 (3 Replies)
Is there an easy way in sed to remove a character and values
after that character?
ex:
blackout_10-11-2011(NODE_LEVEL)
I want to remove '(' and everything after. so I will only have.
blackout_10-11-2011
I can use a cut command to do this but interested in seeing how its done... (1 Reply)
Hello i am trying to remove the html format from the file using sed. for example remove <p> </p>
i tried to do this : sed -e 's/<*>//g' test > test.t
but still i have some html format . please help if you have any suggestions
lets say this is the html file
1... (11 Replies)
I have a file and I want to remove quotes from the word " ` " through sed command but unable to remove
I am using below command
sed s/"`XYZ`"/"ZXY"/g file1.txt > file2.txt
But this is not working. How can we remove "`" through sed command (2 Replies)
I would like produce
blue, green, red, yellowfrom"blue:,*green:,*red:,*yellowI can remove the colon with
echo "blue:,*green:,*red:,*yellow" | sed 's/://g'which givesblue,*green,*red,*yellowbut when I try
echo "blue:,*green:,*red:,*yellow" | sed 's/://g'; 's/*//g'I get bash: s/*//g: No such... (9 Replies)