Re: Escaping with tr




Wiggins d'Anconia said:
> Scott Taylor wrote:

I did not.

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

It is not uncommon to find CSV output in the format he describes. Often I
need to remove all the quotes out of simple data streams like that.

--
Scott
.



Relevant Pages

  • Re: Escaping with tr
    ... >>How can I get all the " characters out of a csv file. ... Simply removing *all* double quotes can be a ... dangerous proposition unless your data really does look like "bla bla" ... specific fields because they may contain the delimiter, ...
    (perl.beginners)
  • Re: INSERT Query problem with Quotes & Apostrophes
    ... something like that whereby Access does this for you, as the double quotes ... > delimiter symbol in your string. ... If your user has the Short Date format set to ...
    (microsoft.public.access.modulesdaovba)
  • Re: INSERT Query problem with Quotes & Apostrophes
    ... What you have to do is decide whether you want to use single quotes or ... delimiter symbol in your string. ... > Set cmd1 = New ADODB.Command ...
    (microsoft.public.access.modulesdaovba)
  • Re: Command() and cmd ("Dos") vs Run menu (WinXP)
    ... > the delimiter is not a standard. ... > Sometimes it uses a space (uses double quotes to make it ignore the ... The old 8.3 file naming standard did not ... or more fixed characters in order to allow for different kinds of ...
    (microsoft.public.vb.enterprise)
  • Re: Command() and cmd ("Dos") vs Run menu (WinXP)
    ... > the delimiter is not a standard. ... > Sometimes it uses a space (uses double quotes to make it ignore the ... The old 8.3 file naming standard did not ... or more fixed characters in order to allow for different kinds of ...
    (microsoft.public.vb.general.discussion)