How to remove quotes, commas, from numbers (considered as strings)?
- From: "sherifffruitfly" <sherifffruitfly@xxxxxxxxx>
- Date: 22 Dec 2006 14:26:34 -0800
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
.
- Follow-Ups:
- Prev by Date: Re: my first .net 3.0 question
- Next by Date: Re: Memory Limit for Visual Studio 2005???
- Previous by thread: Help with OO Model
- Next by thread: Re: How to remove quotes, commas, from numbers (considered as strings)?
- Index(es):
Relevant Pages
|