removing " within the file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting removing " within the file
# 1  
Old 08-23-2006
removing " within the file

is there any way to remove " from the string within the line , keeping the content same.

lets say may file is test.csv
and data with in this :

Code:
"25Jul06,31Jul06,A"
"8,260C,700C,GBP,46090.46,,700C55815009251260C,30Jul06,,,SGD,135045.05,2.9300000,01,1"
"4,260C,700C,GBP,108401.78-,,700C56477800027260C,30Jul06,,,SGD,317617.22-,2.9300000,01,1"

now want to get the
Code:
25Jul06,31Jul06,A
8,260C,700C,GBP,46090.46,,700C55815009251260C,30Jul06,,,SGD,135045.05,2.9300000,01,1
4,260C,700C,GBP,108401.78-,,700C56477800027260C,30Jul06,,,SGD,317617.22-,2.9300000,01,1

# 2  
Old 08-23-2006
the transform option? tr

I'm not sure of the syntax off teh top of my head but it should just remove every instance of the character on the line...

hope it is a help.
# 3  
Old 08-23-2006
for example to remove all % signs

tr -d "%"

maybe the " being your target if you used an escaped "
# 4  
Old 08-23-2006
that is not giving me a result

can this be a solutions

sed 's/[ ]"//g' filename > newfile

since i am directly dealing with file, so all string which is with in " should be replace by null
# 5  
Old 08-23-2006
try this

Code:
sed 's/"//g' test.csv

# 6  
Old 08-23-2006
You can use sed or perl....

Code:
sed 's/\"//g' test.csv > newtest.csv

perl -i -pe 's/\"//g' test.csv

I prefer using the perl command as it does not have the added overhead of creating a new file.
# 7  
Old 08-23-2006
Quote:
sed 's/\"//g' test.csv > newtest.csv
the \ is not needed - coloured one
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing duplicates on a single "column" (delimited file)

Hello ! I'm quite new to linux but haven't found a script to do this task, unfortunately my knowledge is quite limited on shellscripts... Could you guys help me removing the duplicate lines of a file, based only on a single "column"? For example: M202034357;01/2008;J30RJ021;Ciclo 01... (4 Replies)
Discussion started by: Rufinofr
4 Replies

2. UNIX for Dummies Questions & Answers

Removing "'" from a file

Hi I have a file in which the last characters are ' and space, i.e Code ==== abcn' jkdjf dkfjd' Here in the above code, 1st line is having the comma as the last character and in the 2nd line space is the last character, I want to delete these character if it is there. Please guide me... (5 Replies)
Discussion started by: Pramod_009
5 Replies

3. Shell Programming and Scripting

PERL "filtering the log file removing the duplicates

Hi folks, I have a log file in the below format and trying to get the output of the unique ones based on mnemonic IN PERL. Could any one please let me know with the code and the logic ? Severity Mnemonic Log Message 7 CLI_SCHEDULER Logfile for scheduled CLI... (3 Replies)
Discussion started by: scriptscript
3 Replies

4. Shell Programming and Scripting

Removing "^M" from the end of a String (i.e. "Ctrl+M")?

Hello All, I have an Expect script that ssh's to a remote server and runs some commands before exiting. One of the commands I run is the "hostname" Command. After I run this command I save the output using this line in the code below... Basically it executes the hostname command, then I... (2 Replies)
Discussion started by: mrm5102
2 Replies

5. Shell Programming and Scripting

Removing comma "," in a field value in csv file

Hi, I have csv file with records as below. Now i have remove any comma in the filed value because that creates problem when i feed this file to an application. for example below are two sample records, the second record have a comma in "Salesforce.com, Inc." field, now i have to remove this... (13 Replies)
Discussion started by: anaga
13 Replies

6. Shell Programming and Scripting

Removing "Hidden Characters" on a file

Hi - I'm having a problem with hidden characters on Linux. When I produced an output from Oracle database, there is a an extra "Hidden Character" included on the output. How can I remove that character? See below: The extra dollar sign is creating a new line on my .csv output file. I... (16 Replies)
Discussion started by: Jin_
16 Replies

7. 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

8. Shell Programming and Scripting

Removing special characeter "~V" in a unix file

I have the Unix XML file as below: <?xml version="1.0" encoding="UTF-8"?> <ReportData version="1.0"><DisplayName>Non-Agency CMO Daily Trade Recap - Hybrids</DisplayName><ReportType>MgmtTradingReport</ReportType><Description>Management Trading... (7 Replies)
Discussion started by: mohsin.quazi
7 Replies

9. Solaris

removing "/" file system from solaris volume

Hi all, I have created a volume for the root device as d0 and the sub mirror for same is d10. the output from metastat d0 is as below I want to clear these volume , as i cant unmount the "/ " file system , please suggest as how can i clear this. Also the required entries are there... (2 Replies)
Discussion started by: kumarmani
2 Replies

10. Shell Programming and Scripting

removing the "\" and "\n" character using sed or tr

Hi All, I'm trying to write a ksh script to parse a file. When the "\" character is encountered, it should be removed and the next line should be concatenated with the current line. For example... this is a test line #1\ should be concatenated with line #2\ and line number 3 when this... (3 Replies)
Discussion started by: newbie_coder
3 Replies
Login or Register to Ask a Question