Jamn .playit
2017-02-09 16:55:20 UTC
I do not have to script very often and as such I was wondering anyone could provide some base syntax for a simple script I need to create.
I have a file that will either start with a '1' or a '2' as the first character of each line.
I need to read the file then put each line that starts with '1' in an array and each that starts with '2' into another. Finally simply write each array into a separate file.
I was using something similar in another script but it has been so long since I had to really code I have forgotten a lot and kind of need this in a hurry, any help would be appreciated. Is it as simple as just using a get left = x?
While expfile.AtEndOfStream = False
expreadline = expfile.readline
'make sure we don't read any blank lines into the array
If instr(expreadline,"") > 0 then
<this is where i need some syntax>
exparray(counter) = expreadline
'exparray2(counter) = expreadline2
'make sure we don't read past the end of our data
If expfile.AtEndOfStream = False then
counter = counter + 1
ReDim Preserve exparray(counter)
Redim Preserve exparray2(counter)
End If
I have a file that will either start with a '1' or a '2' as the first character of each line.
I need to read the file then put each line that starts with '1' in an array and each that starts with '2' into another. Finally simply write each array into a separate file.
I was using something similar in another script but it has been so long since I had to really code I have forgotten a lot and kind of need this in a hurry, any help would be appreciated. Is it as simple as just using a get left = x?
While expfile.AtEndOfStream = False
expreadline = expfile.readline
'make sure we don't read any blank lines into the array
If instr(expreadline,"") > 0 then
<this is where i need some syntax>
exparray(counter) = expreadline
'exparray2(counter) = expreadline2
'make sure we don't read past the end of our data
If expfile.AtEndOfStream = False then
counter = counter + 1
ReDim Preserve exparray(counter)
Redim Preserve exparray2(counter)
End If