Ignore escape sequence in sed

Friends,

In the file i am having more then 100 lines like,

File1 had the values like this:

 
#Example East.server_01=EAST.SERVER_01
East.server_01=EAST.SERVER_01
West.server_01=WEST.SERVER_01

File2 had the values like this:

 
#Example EAST.SERVER_01=http://yahoo.com
EAST.SERVER_01=http\://google.com
WEST.SERVER_01=http://google1.com
 

After the running the sed command File1 should be:

 
#Example East.server_01=EAST.SERVER_01
East.server_01=http\://google.com
West.server_01=http://google1.com

But i am getting the value like below in File1:

 
#Example East.server_01=EAST.SERVER_01
East.server_01=http://google.com
West.server_01=http://google1.com

If the line had Escape sequence like (\) in Url it is ignoring in output, but i need that (\) for my Application configuration.

Similarly If the line start with (#) we need to ignore the line, with out sed operation

Could you please check on this,

Thanks in Advance
JB

I don't understand!

First, please use code tags around the file contents; not around the contents AND the descriptions of the contents.

Second, are you saying that your input files contain code to change font and color; or is that just something you added to confuse us? Do we really have to parse the font and color changes within these lines so we not only copy changes to text but also possible changes to font, color, boldness, and italicization?

Third, you say that comment lines are to be ignored, but instead of ignoring them in the output, you add a space to the start of comment lines??? What do you mean by ignore: Do not change comment lines, or delete comment lines?

Fourth why would you limit us to using sed for this? Your specification of what is supposed to happen is ambiguous, but it seems that awk would be a much better tool for this job.

1 Like

Could pls check now...

---------- Post updated at 04:26 PM ---------- Previous update was at 04:26 PM ----------

Could pls check now..

Thank you for fixing the code tags.

Please answer the remaining questions:

  1. Are you saying that your input files contain code to change font and color; or is that just something you added to confuse us? Do we really have to parse the font and color changes within these lines so we not only copy changes to text but also possible changes to font, color, boldness, and italicization?
  2. What do you mean by ignore comment lines?
  3. Why would you limit us to using sed for this? Your specification of what is supposed to happen is ambiguous, but it seems that awk would be a much better tool for this job.