unix file utilities


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting unix file utilities
# 1  
Old 04-02-2009
unix file utilities

Hi experts,

How can i eliminate double quotes within double quotes from a file in unix?

input
====

a,""b,"",d,f,""ggh-,"",dshgdg,dhhdhhkhk,""-gh,""

output
======

a,"b,",d,f,"ggh-,",dshgdg,dhhdhhkhk,"-gh,"


There are somany fields like that in a file. Can anyone please help me out to solve the prob.


Thanks in an advance.

-subhendu-
# 2  
Old 04-02-2009
Code:
$ sed 's/,"/,/g' inputfilename
a,"b,",d,f,"ggh-,",dshgdg,dhhdhhkhk,"-gh,"

Thanks
SHa
# 3  
Old 04-02-2009
Thanks for this ..but it may possible that the comma is present some where else like

input
====
a,""b,"",d,f,""ggh-,"",dshgdg,""dhhd,hhkhk"",""-gh,""

then what will be the solution?
# 4  
Old 04-02-2009
you can Use something like this...

Code:
sed 's/""/"/g' inputfilename
a,"b,",d,f,"ggh-,",dshgdg,dhhdhhkhk,"-gh,"
a,"b,",d,f,"ggh-,",dshgdg,"dhhd,hhkhk","-gh,"

Thank
SHa
# 5  
Old 04-02-2009
Quote:
Originally Posted by subhendu81
input
====

a,""b,"",d,f,""ggh-,"",dshgdg,dhhdhhkhk,""-gh,""

output
======

a,"b,",d,f,"ggh-,",dshgdg,dhhdhhkhk,"-gh,"
Code:
tr -s '"' < FILE

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Crontab utilities

Hi gurus/lead, I have one doubt in crontab. I have shell script source code in one server. where I don't have priviliges acess R/W the shell script in that server. how can I setup the crontab to pick the code from the other unix server ? whether is there any possibility. in my... (1 Reply)
Discussion started by: ramkumar15
1 Replies

2. UNIX for Dummies Questions & Answers

cut/fgrep (UNIX utilities)

Hi I need to download unix utilities for my windows OS as i need to use cut/fgrep command. Can any one help me with this please. Thanks a lot (1 Reply)
Discussion started by: syseq
1 Replies

3. UNIX for Advanced & Expert Users

utilities

hi experts, i have a file sample: ======= 000123 5 7 0008 00345 5 9 0004 how can i get an output as 123 5 7 8 345 5 9 4 thanks in an advance subhendu (5 Replies)
Discussion started by: subhendu81
5 Replies

4. UNIX for Advanced & Expert Users

non GNU utilities

Hi Chaps, Does anyone know of a source of proprietary unix utilities. I often fall into the trap of testing a spot of code on my linux machine, posting the answer in the forums and then realise that the solution may only work with the GNU utils that I use, and not standard posix ones (if there are... (4 Replies)
Discussion started by: wempy
4 Replies

5. UNIX for Dummies Questions & Answers

installing softwares and utilities in unix

Greetings to Everyone, iam a new unix learner , can anyone tell me how to install softwares and utilities in unix, (comparing with windows installation) . in windows we use to install softwares like executing a "exe" file with "next,next....finish." Give me some details abt "how the setup... (1 Reply)
Discussion started by: vijayq8
1 Replies

6. UNIX for Dummies Questions & Answers

bc and wc utilities???

Hi, Can anybody explain bc and wc system utilities in Unix? Thanks (6 Replies)
Discussion started by: skyineyes
6 Replies

7. Shell Programming and Scripting

Awk Utilities

Hi, My input file is like this 1 11110001 1.1.1.1.1 2 12222212 2.3.44.5.6 3 22223333 1.3.2.4.1.55 Now i need the 2nd column value get printed I tried with the following command awk 'NR==1 {print $2}' input this works fine for only 1st row.I need to change always NR assigned value to... (10 Replies)
Discussion started by: jyo123.jyothi
10 Replies

8. UNIX for Dummies Questions & Answers

compression utilities

I've noticed bzip2 gives a little bit better compression than gzip. So...I'm curious...what's gives the best compression out of all the compression utilities? Thanks! (6 Replies)
Discussion started by: jalburger
6 Replies
Login or Register to Ask a Question