❔ Csv textfieldparser
csv:
i can read one line at a time but how would i got about getting the values of that line (for example i want just qford or just 300 or just the type)
11 Replies
split the string on
;
?
are you making a csv parser for fun/learning?yes
if not, consider using CsvHelper
k
if it helps heres what i have right now
okay, and you are trying to write
parser.ReadFields();
?no that part is something i forgot to remove to be honest
i was seeing what fields were
and looking at everything parser can do
wait i think uve actually helped me
uhm.. is
TextFieldParser
actually Microsoft.VisualBasic.FileIO.TextFieldParser
?now i think about it i can split the string into an array with the ;
ye
oh, okay.
I mean, I thought you were writing a csv parser from scratch
TFP is essentially feature complete, if a bit more basic than CsvHelper
ReadFields
should handle the splitting for you
remember that string.Split
returns string[]
just like ReadFields doesalright
thanks
that will help me on my way
ye so reading the line and then reading the fields worked
thanks
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.