Hi
Sometime ago i had posted a request for code to parse a line of text
containing Quotes and Commas, the code posted by the gentleman did work for
sometime but does not work for the following
104528558,"New iPod FM Transmitter & Car Charger
$1Res(E107)","/Electronics-photography/Portable-audio-iPods/iPod-accessories/FM-Transmitters-iTrips","Jun
21 2007 12:28PM","Fixed price offer",29,"$6 Courier Nationwide (Rural +3)
No pick-ups allowed","$6.00 Courier Nationwide (Rural
+3)","kjc",,,"kyliec@astra.co.nz",0,3.25,1.71,,1,1,39.95,"Jun 13 2007
9:00PM","7 days",,"yes","yes","yes","no","no","no",5,,"no"
the following is the code that does not work for the above
Regex regex = new
Regex("((?<field>[^\",\\r\\n]+)|\"(?<field>([^\"]|\"\")+)\")(,|(?<rowbreak>\\r\\n|\\n|$))");
Can someone help
Barry
Göran Andersson - 24 Jun 2007 13:53 GMT
> Sometime ago i had posted a request for code to parse a line of text
> containing Quotes and Commas, the code posted by the gentleman did work for
[quoted text clipped - 12 lines]
>
> Can someone help
What exactly do you mean by "does not work"?
I tried it, and it works just fine.

Signature
Göran Andersson
_____
http://www.guffa.com
Barry - 25 Jun 2007 08:56 GMT
Yes, it does work, my question was slightly incorrect.
It works but return ONLY 26 of the 30 expected fields, whenever there are
"124",,,"152"
it will show return only 2 fileds not 4 for the above line
You can try to create a csv file with my line of text and open a excel sheet
for testing.
Correct me if i am wrong.
>> Sometime ago i had posted a request for code to parse a line of text
>> containing Quotes and Commas, the code posted by the gentleman did work
[quoted text clipped - 17 lines]
>
> I tried it, and it works just fine.
Göran Andersson - 25 Jun 2007 18:01 GMT
> Yes, it does work, my question was slightly incorrect.
>
[quoted text clipped - 28 lines]
>>
>> I tried it, and it works just fine.
Yes, the pattern does not include empty items.
To make it include empty non-quoted items, change the first + to *.
To make it include empty quoted items, change the second + to *.

Signature
Göran Andersson
_____
http://www.guffa.com
1store - 25 Jun 2007 04:37 GMT
What type of website are your trying to make?
Barry - 25 Jun 2007 08:58 GMT
does it matter, for all you know i may not be trying to make a website at
all, i could be using it for a different purpose, that is immaterial for the
posting
> What type of website are your trying to make?
1store - 25 Jun 2007 04:38 GMT
What type of website are your trying to make?