How to replace quote symbol(") and dot(.) with some other values!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to replace quote symbol(") and dot(.) with some other values!!
# 1  
Old 04-28-2012
How to replace quote symbol(") and dot(.) with some other values!!

Hi ,

I have below input file

Code:
1.order number is useful.
2.vendor_id is produced.
3.the vandor name is "malawar".

I want output file like

Code:
1. order number is useful.
2. vendor_id is produced.
3. the vandor name is VmalawarV.

in input file line number 1.order number there is no space between . and order.
i want like 1. order number i want to include space between 1. and order.
Then If i found double quotes (") any where that has to be replaced with entitie number V.

Please help me to achieve this.

Thanks,
vinoth

Moderator's Comments:
Mod Comment Please click this link: How to use [code][/code] tags

Last edited by Scrutinizer; 04-28-2012 at 07:14 AM..
# 2  
Old 04-28-2012
Try this,

Code:
 sed 's/\(\.\)/\1 /g; s/\"/\&#086/g' txt

# 3  
Old 04-28-2012
Hi Indhumathy ,

It works but it is replacing all the .(dot).

I have the below line from the file as input

1.Hi this software version 1.0 is useful.But not used everywhere.

I want output like below

1. Hi this software version 1.0 is useful. But not used everywhere.

In I dont want to replace the .(dot) in some places.

I have to replace at the begining of the line 1. Hi this .
I have to replace at the end of each line useful. But not

Please help.
# 4  
Old 04-28-2012
Kindly Try with this for replacing ".",

Code:
sed 's/\(\.\)\([a-zA-Z]\)/\1 \2/g' txt

Regards,
Indu

Last edited by Indumathy; 04-28-2012 at 09:53 AM..
# 5  
Old 04-29-2012
Thanks Indhu,it works thanks a lot.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace null values with dot using awk

Using awk I am trying to replace all blank or null values with a . in the tad delimited input. I hope the awk is close. Thank you :). input name test sam 1 liz 2 al 1 awk awk 'BEGIN{FS=OFS="\t"}{for(i=1;++i<NF;)$i=$i?$i:"."}1'input awk 'BEGIN { FS =... (6 Replies)
Discussion started by: cmccabe
6 Replies

2. Shell Programming and Scripting

How to replace with "sed" some hex values by other hex values?

Assume I have a file \usr\home\\somedir\myfile123.txt and I want to replace all occurencies of the two (concatenated) hex values x'AD' x'A0' bytwo other (concatenated) hex values x'20' x'6E' How can I achieve this with the gnu sed tool? Additional question: Is there a way to let sed show... (1 Reply)
Discussion started by: pstein
1 Replies

3. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

Hello. Following recommendations for one of my threads, this is working perfectly : #!/bin/bash CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" ) Now I need a grep success for some thing like : #!/bin/bash CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies

4. Shell Programming and Scripting

Substituting comma "," for dot "." in a specific column when comma"," is a delimiter

Hi, I'm dealing with an issue and losing a lot of hours figuring out how i would solve this. I have an input file which looks like this: ('BLABLA +200-GRS','Serviço ','TarifaçãoServiço','wap.bla.us.0000000121',2985,0,55,' de conversão em escada','Dia','Domingos') ('BLABLA +200-GRR','Serviço... (6 Replies)
Discussion started by: poliver
6 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Regular Expression doesn't match dot "." in a string

hello, I am writting a regular expression that intend to match any tunnel or serial interface but it doesn't mtach any serial sub-interface. For example, statement should match "Tunnel3" or "Serial0/1" but shouldn't match "Serial0\1.1" (doesn't include dot ".") I tried the following but... (3 Replies)
Discussion started by: ahmed_zaher
3 Replies

7. Shell Programming and Scripting

Set command ending with a "." (dot)

Hi I have a "set" command which ends with a "." (dot), for example: set `grep "\<${pnum}\>" /tstmp/data.txt |sed 's/#//'` . Can somebody help me to understand the purpose of this "set" and "." combination? The problem is that this command does not produce the same result when run on AIX... (2 Replies)
Discussion started by: aoussenko
2 Replies

8. HP-UX

Replace all 'low values" in a file

Hi, I've to replace all low values (hex '00') in a flat file (containing more than 1,000,000 records) with space (hex '20'). I try to use: awk '{gsub("\x00","\x20")}' file_name and I obtain the following response: awk: Line AP000010536900577986 cannot have more than 199 fields.... (2 Replies)
Discussion started by: sw.an
2 Replies

9. Shell Programming and Scripting

Regex in grep to match all lines ending with a double quote (") OR a single quote (')

Hi, I've been trying to write a regex to use in egrep (in a shell script) that'll fetch the names of all the files that match a particular pattern. I expect to match the following line in a file: Name = "abc" The regex I'm using to match the same is: egrep -l '(^) *= *" ** *"$' /PATH_TO_SEARCH... (6 Replies)
Discussion started by: NanJ
6 Replies

10. UNIX for Dummies Questions & Answers

Why is it Bad Idea to insert "." (Dot) to PATH ?

I was told that it's a Bad Idea (especially for root ) to Add To the Variable $PATH in unix the ":." (dot), In order to execute programs in my current directory without typing ./program For example: PATH=$PATH:$HOME/bin:. Does someone know why is it a Bad Idea? (2 Replies)
Discussion started by: amitbern
2 Replies
Login or Register to Ask a Question