Search code examples
vb.netfileparsingstreamreaderflat

Breaking up a fixed length flat file into fields


so i have a file that i need to read in vb.net. Each line is 32 chars long and each line consists of multiple fields. Meaning from char 1 to 9 it idicates ID then char 10 indicates an identifier,11-14 indicates a value field. I've looked at Readblock and it's not the tool for the job. Is there a way to break up each line into its respective fields other than just reading the whole line and breaking it up as a string?


Solution

  • Reading it in and breaking it up is probably the simplest solution. If this is a one-off job, or if you don't expect the string format to change, then going with the simplest, quickest route is probably best.