I'm attempting to import comma delimited data into an array but need to replace the 187th element of each line if the total number of commas in the string is equal to 192. The problem being that I can't determine the number of commas in the string.
Sample .txt file : https://www.dropbox.com/s/12oi5njdexstt74/Sample.txt?dl=0
When I use the code below and the sample file above, N_OC returns 37 when there are a total of 192 commas in the string.
However, when I further decide to delimit the string into an array using the following code, the correct number of elements are created.
Thanks in advance
Sample .txt file : https://www.dropbox.com/s/12oi5njdexstt74/Sample.txt?dl=0
When I use the code below and the sample file above, N_OC returns 37 when there are a total of 192 commas in the string.
Code:
MyData = Input(LOF(fileNumber), [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=fileNumber]#fileNumber[/URL] )
Close [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=fileNumber]#fileNumber[/URL]
strData = Split(MyData, vbCrLf)
For Each Item In strData
N_OC = InStr(1, Item, ",")
Next Item
However, when I further decide to delimit the string into an array using the following code, the correct number of elements are created.
Code:
Str_Array = Split(strData(i), ",")
Thanks in advance