Volkmaniac
Technical User
Knob showed me a way I could count occurrences of an item within a text file:
fopen 1 fname read text
While not feof 1
fgets 01 sLine
If strncmp sLine "CCXXXX" 6
A++
else
If strncmp sLine "CCXXA" 5
B++
else
If strncmp sLine "CCXB" 4
C++
else
Now I'd like to take things a step further. Is there a way I can conduct the same type of search but only on specific columns within a file? For instance, let's say I have a file layout that tells me that a two digit code is in position 220-221 of each record in a file. Is there a way I can tell the script to only search those specific positions?
fopen 1 fname read text
While not feof 1
fgets 01 sLine
If strncmp sLine "CCXXXX" 6
A++
else
If strncmp sLine "CCXXA" 5
B++
else
If strncmp sLine "CCXB" 4
C++
else
Now I'd like to take things a step further. Is there a way I can conduct the same type of search but only on specific columns within a file? For instance, let's say I have a file layout that tells me that a two digit code is in position 220-221 of each record in a file. Is there a way I can tell the script to only search those specific positions?