Code: Select all
open file "attendance.txt" for read
read from file "attendance.txt" until eof
close file "attendance.txt"
put it into myVar
repeat with i = 40 to 1
if the first character of line i of myVar is "1" or "0" or ","
then
delete line i of myVar
end if
end repeat
breaking the if statement into 3 separate if statements, one for each of 3 possible first characters.
putting the if statements in a do command thinking that the variable "i" might not be being read properly
using "character 1 of line i" instead of "the first character of line i"
using "put empty into line i of myVar" instead of "delete line i of myVar"
placing myVar into a text box and trying to remove the lines from the text box
every combination of the above changes I could think of
Any suggestions would be much appreciated.