Re: Escaping with tr
- From: scott@xxxxxxxxxxxxxxx (Scott Taylor)
- Date: Tue, 30 Aug 2005 14:40:57 -0700 (PDT)
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
.
- References:
- Re: Escaping with tr
- From: Scott Taylor
- Re: Escaping with tr
- From: Wiggins d'Anconia
- Re: Escaping with tr
- Prev by Date: Re: Escaping with tr
- Next by Date: how to replace multiple whit space with ", ".
- Previous by thread: Re: Escaping with tr
- Next by thread: Re: Escaping with tr
- Index(es):
Relevant Pages
|
|