Re: Escaping with tr



Scott Taylor wrote:

>>Hi,
>>
>>How can I get all the " characters out of a csv file.
>>
>>Input looks like
>>"bla bla";"bla bla";"bla bla"
>>
>>and it has to look like
>>bla bla;bla bla; bla bla
>>
>>I tried $text=~ tr(#\"##);
>>but perl keeps complaining about "Might be a runaway multi-line ;;"
>
>

On a more serious note. Simply removing *all* double quotes can be a
dangerous proposition unless your data really does look like "bla bla"
which I somewhat doubt. Usually a delimited file like this will quote
specific fields because they may contain the delimiter, in this case a
semi-colon. Are you sure "bla bla" can't be "blah; blah blah", and then
in the future need to still be delimited by the semi-colon?

Just checking...

http://danconia.org
.



Relevant Pages

  • Re: Escaping with tr
    ... > Scott Taylor wrote: ... > dangerous proposition unless your data really does look like "bla bla" ... > specific fields because they may contain the delimiter, ... need to remove all the quotes out of simple data streams like that. ...
    (perl.beginners)
  • Re: Basic Program to Import a CSV file
    ... With the risk of sounding like Tom, I'll mention that I use OpenOffice, but I could just save my OO spreaadsheets as Excel files before using ExcelExport. ... ExcelExport ensures that all fields are wrapped in quotes, ... shows fields are delimited by commas. ... Each row of the CSV file would be a record in the deals.mv file, ...
    (comp.databases.pick)
  • Re: Too Many Data Fields in Mail Merge
    ... All of our letters use a CSV file as its data source. ... One or two letters do prompt for the delimiter, ... Our data source comes out of a Letter Generation tool in PeopleSoft ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Removing quotes from a csv file after DoCmd.TransferText
    ... If you want to create a CSV file without quotes around the field values, ... Advanced button in the wizard and save the specification under a convenient ... you can use this command: ...
    (microsoft.public.access.externaldata)
  • Re: List Separator
    ... Excel follow the delimiter specified as the List Separator in the ... Not loading correctly means the delimiter is being ignored. ... confirms that Excel believes the delimiter to be a semicolon! ... very short csv file in note pad. ...
    (microsoft.public.excel.programming)