I'm using Aspect to read a tab-delimited file for making lots of changes in a PBX all at once:
Data reads in fine and I send to the PBX fine. The problem is the last column read from the file also picks up the carriage return at the end of the line. I added an extra tab (dummy column) to each line to make it work.
My question is whether this is "normal" behavior and is there a way to avoid this without always adding an extra column. If I leave off or make the '1' a '0' in the last strtok line (strtok varNAM sLine "`t" 1 in this case) will that do the trick?
Steve Harmon
Greenfield, Indiana
Code:
proc main
string sLine, varTN,varTYP,varDN1,varDN2,varNAM
fopen 0 "scr.txt" READ
transmit "****^M"
waitfor ">"
transmit "ld 20^M"
while not feof 0
fgets 0 sLine
strtok varTN sLine "`t" 1
strtok varTYP sLine "`t" 1
strtok varDN1 sLine "`t" 1
strtok varDN2 sLine "`t" 1
strtok varNAM sLine "`t" 1
My question is whether this is "normal" behavior and is there a way to avoid this without always adding an extra column. If I leave off or make the '1' a '0' in the last strtok line (strtok varNAM sLine "`t" 1 in this case) will that do the trick?
Steve Harmon
Greenfield, Indiana