N
neverends
Hi. So heres my problem: I read in lines of text from a text file an
place all of them in an array. I then trim off any extra space on th
right and left sides. There is one line that has quotes at th
beginning and end and will have a comma in the middle. I want to tak
everything to the left of the comma and place it in (1,1) of a
dimensional array then take everything to the right of the comma an
place it in (2,1) of the 2 dimensional array. My code is below.
stepped through it and when it gets to the if statement and the arra
value meets the requirements (ex. ""Somwhere, AB 12345"") it just jump
to the end if. Can anyone help? Thanks in advance.
Code
-------------------
quotes = """" & "*" & """"
If prelimarray(i) = quotes Then
counter2 = 1
For p = 0 To counter
If prelimarray(i) <> "" Then
counter2 = counter2 + 1
indexposition = InStr(1, prelimarray(i), ",") + 1
arrayofstrings(1, counter2) = Left(prelimarray(i), InStr(1, prelimarray(i), ","))
arrayofstrings(2, counter2) = Mid(prelimarray(i), indexposition, Len(prelimarray(i)))
arrayofstrings(1, counter2) = LTrim(arrayofstrings(1, counter2))
End If
Next p
End I
place all of them in an array. I then trim off any extra space on th
right and left sides. There is one line that has quotes at th
beginning and end and will have a comma in the middle. I want to tak
everything to the left of the comma and place it in (1,1) of a
dimensional array then take everything to the right of the comma an
place it in (2,1) of the 2 dimensional array. My code is below.
stepped through it and when it gets to the if statement and the arra
value meets the requirements (ex. ""Somwhere, AB 12345"") it just jump
to the end if. Can anyone help? Thanks in advance.
Code
-------------------
quotes = """" & "*" & """"
If prelimarray(i) = quotes Then
counter2 = 1
For p = 0 To counter
If prelimarray(i) <> "" Then
counter2 = counter2 + 1
indexposition = InStr(1, prelimarray(i), ",") + 1
arrayofstrings(1, counter2) = Left(prelimarray(i), InStr(1, prelimarray(i), ","))
arrayofstrings(2, counter2) = Mid(prelimarray(i), indexposition, Len(prelimarray(i)))
arrayofstrings(1, counter2) = LTrim(arrayofstrings(1, counter2))
End If
Next p
End I