Is there a way to split lines of comma-separated text into individual strings, except when the commas are somewhere between quotes? For example, given this line:
"test",a,20110101,"hello there, my friend",,b
I want to split it into these six strings:
"test"
a
20110101
"hello there, my friend"
b
Note that the empty strings are significant. After the split I'll strip all beginning and ending quotes from the individual strings. That I can handle! I just can't seem to figure out how to do the split.
As always, I appreciate your assistance.
"test",a,20110101,"hello there, my friend",,b
I want to split it into these six strings:
"test"
a
20110101
"hello there, my friend"
b
Note that the empty strings are significant. After the split I'll strip all beginning and ending quotes from the individual strings. That I can handle! I just can't seem to figure out how to do the split.
As always, I appreciate your assistance.