B
bob
Hi
I need to replace the nth field in a CSV record with a new value,
Having trouble figuring out a regex that will capture the nth field.
I have a regex that captures every field in the record
but can't see an efficient way of making use of the matches collection
to build the required output string.
i.e. Don't want to iterate through the m[0].Groups collection
appending to a string builder when I figure I could use a replace
function if I had the right regex to count out n fields.
e.g.
MyRecord,"","","",""
replaced with
MyRecord,"","","NewValue",""
Any ideas?
Thanks
Bob
I need to replace the nth field in a CSV record with a new value,
Having trouble figuring out a regex that will capture the nth field.
I have a regex that captures every field in the record
but can't see an efficient way of making use of the matches collection
to build the required output string.
i.e. Don't want to iterate through the m[0].Groups collection
appending to a string builder when I figure I could use a replace
function if I had the right regex to count out n fields.
e.g.
MyRecord,"","","",""
replaced with
MyRecord,"","","NewValue",""
Any ideas?
Thanks
Bob