Re: How to remove quotes, commas, from numbers (considered as strings)?
- From: "chanmm" <chanmmn@xxxxxxxxxxx>
- Date: Mon, 25 Dec 2006 18:15:53 +0800
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
.
- References:
- How to remove quotes, commas, from numbers (considered as strings)?
- From: sherifffruitfly
- How to remove quotes, commas, from numbers (considered as strings)?
- Prev by Date: Re: Serialize a generic collection of interfaces?
- Next by Date: Re: cheking hold process
- Previous by thread: How to remove quotes, commas, from numbers (considered as strings)?
- Next by thread: Re: How to remove quotes, commas, from numbers (considered as strings)?
- Index(es):
Relevant Pages
|