Re: How to remove quotes, commas, from numbers (considered as strings)?



Can you be explicitly use String.Replace than Regex.Replace?

chanmm

"sherifffruitfly" <sherifffruitfly@xxxxxxxxx> wrote in message news:1166826394.866732.167070@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,

I've got a csv file for numeric data, some of which are greater than
10^3. Some bright fellow trying to br helpful put US-standard commas in
these numbers, and to maintain the correct cell-index put quotation
marks around the comma'd result.

Example csv line:

43.56,345.2,"1,285,100",45.6

I would like to replace the quoted-comma'd numbers with their
unquoted-uncomma'd versions. I'm reading the csv line-by-line, putting
a line into a string called csvLine. I'd like to call the static
Regex.Replace method, in a way such as the following:

Regex.Replace(csvLine, quotedCommadNumberPattern,
noQuotesNoCommasPrevArg)

I can come up with the regular expression for the second argument. But
I'm not sure about the third. In particular, how can I make a regular
expression refer to "the digits in what was found in the previous
argument"?

Or am I going about this all wrong?

Thanks for any ideas,

cdj


.



Relevant Pages

  • How to remove quotes, commas, from numbers (considered as strings)?
    ... I've got a csv file for numeric data, some of which are greater than ... Some bright fellow trying to br helpful put US-standard commas in ... I can come up with the regular expression for the second argument. ...
    (microsoft.public.dotnet.languages.csharp)
  • Regular Expression Question
    ... two extensions. ... Basicly I need it to mean not *.a nor *.csv. ... Does anyone know what the proper regular expression is? ...
    (comp.lang.perl)
  • Re: Regular Expression Question
    ... > The best I can come up with based on books and online sources is ... not matching *.a or *.csv: ...
    (comp.lang.perl)
  • Re: How can I remove leading zeros?
    ... And you can remove the "dim cctr as long", ... create additional CSV files ... 'CREATE A CSV FILE ... "Dave Peterson" wrote: ...
    (microsoft.public.excel.programming)
  • Re: How can I remove leading zeros?
    ... RemoveLeadingZeros = myStr ... create additional CSV files ... 'CREATE A CSV FILE ... Dim myCell As Range ...
    (microsoft.public.excel.programming)