One of the best ways to get round the problem of referring to double quotes is to use its ASCII value instead. This is 34.
So as an example of the kind of thing you want to do (but without saving to a database - just displaying what it finds within the quotes), you can use something like this:
- Dim src As String = "C:\Parts.txt" ' name of file
-
Dim sr As New IO.StreamReader(src)
-
Dim checkStr As String = String.Empty
-
Dim result As New ArrayList
-
Do While Not sr.Peek = -1
-
checkStr = sr.ReadLine
-
If checkStr.Contains(Chr(34)) Then
-
Dim first As Integer = checkStr.IndexOf(Chr(34)) + 1
-
Dim last As Integer = checkStr.LastIndexOf(Chr(34))
-
result.Add(checkStr.Substring(first, last - first))
-
End If
-
Loop
-
-
' Display for demo purposes
-
For Each s As String In result
-
Console.WriteLine(s)
-
Next
This code will store the values from between the quotes in any line that has two sets of double quotes in it.
Of course, to make it robust you would need to build in Exception Handling for cases e.g. where there is only one double quote. But if the layout of the data is always as you posted, then the above code will work fine.