vba_php
Forum Troll
- Local time
- Today, 09:36
- Joined
- Oct 6, 2019
- Messages
- 2,880
has anyone ever done this? I attempted to parse these CSV's with a simple method of finding a universal string that was common in all the files, which appears at the end of each one at the 2nd to last field. this is what I'm pointing to and using SPLIT() to gather the array elements, which come in as entire records in the CSV:
so after running this code on files that are actually formatted/downloaded correctly:
I get this collection in the array elements, which is the way it should be:
there's a lot more fields that come in when the actual code runs. the data above is thrown into a second array I have written because the first one using SPLIT() brings in way too much data from the CSV record that is irrelevant. however, on one CSV, SPLIT() throws nothing to the 1st array even though the actual data in the offending file looks like this and has the exact string I'm looking for:
this string is in every CSV file, so this really doesn't make any sense. furthermore, if I try to throw the CSV data into an array by using SPLIT() and specifying the parser as the carriage return vbcrlf, there is *more* than 1 file that doesn't give me anything in the accepting array. I did a presentation for a lady the other day and she complained to me that the Verizon software she was using was downloading invoice records outside the date range she was specifying. That's exactly the same type of problem that is occurring with these people I am referencing with this problem. They are the engineers at the company SQUARE, which is the mobile app payment method for smartphones. These files they are giving customers to download are not reading the same way everytime with respect to an I/O stream conducted in windows using VBA. So who is the culprit here? Windows technology, VBA or the square engineers? My guess would be the engineers at square because I've seen stuff like this happen countless times from large corporations....anyone got any insight on the issue? thanks! and to the subject of this thread, if I used REGEX(), would it make my life easier, and would it solve this problem?
Code:
,ea,
Code:
Line Input #1, streamText
streamArray() = Split(streamText, ",ea,")
Code:
1/11/2019, Payment,60, 1, January
1/11/2019, Payment,12.49, 1, January
1/11/2019, Cedar Rapids,8.5, 1, January
1/11/2019, Cedar Rapids,5.99, 1, January
1/10/2019, Cedar Rapids,6.25, 1, January
this string is in every CSV file, so this really doesn't make any sense. furthermore, if I try to throw the CSV data into an array by using SPLIT() and specifying the parser as the carriage return vbcrlf, there is *more* than 1 file that doesn't give me anything in the accepting array. I did a presentation for a lady the other day and she complained to me that the Verizon software she was using was downloading invoice records outside the date range she was specifying. That's exactly the same type of problem that is occurring with these people I am referencing with this problem. They are the engineers at the company SQUARE, which is the mobile app payment method for smartphones. These files they are giving customers to download are not reading the same way everytime with respect to an I/O stream conducted in windows using VBA. So who is the culprit here? Windows technology, VBA or the square engineers? My guess would be the engineers at square because I've seen stuff like this happen countless times from large corporations....anyone got any insight on the issue? thanks! and to the subject of this thread, if I used REGEX(), would it make my life easier, and would it solve this problem?