I'm not sure what file format you'd like to use for your flat files, but one easy option is to use XML. You can certainly generate your own format, but there's some easy tooling in VB.Net for reading and writing XML files.
To write an xml file:
Public Sub SaveAs(ByVal fileName As String)
Dim writer As Xml.XmlWriter
Dim settings As New Xml.XmlWriterSettings
settings.Indent = True
settings.CloseOutput = True
writer = Xml.XmlWriter.Create(fileName, settings)
writer.WriteStartElement("customer")
writer.WriteStartElement("customerName")
writer.WriteValue("customer #1")
writer.WriteEndElement()
writer.WriteEndElement()
writer.Close()
End Sub
Reading from an XML document you can use some of the inline VB XML language features:
Public Sub Load(ByVal fileName as String)
If Not IO.File.Exists(fileName) Then Throw New Exception("File not found.")
Dim xDoc as XDocument
Try
xDoc = XDocument.Load(fileName)
Catch e as Xml.XmlException
Throw New FileFormatException()
End Try
Dim customers = xDoc..<customer>
For each customer in customers
Dim customerName = customer.<customerName>.Value
//'do something with the data
Next
End Sub
Beth Massi has some good videos on working with XML files and data in VB