script puzzle

andu undo at cloud9.net
Mon Feb 18 17:38:00 EST 2002


This script reads a 5700 line file, each line with 15 "|" delimited
chunks, replaces some items with new values and dumps the result into a
new file. It starts fast but towards the end does less 2 lines per
second. Can't figure out what slows it down. 
(Linux, Athlon 750MHz, 128Mb RAM).
Anyone has a clue? This is done as a command line script, no UI.

on startup
put url ("file:./file.txt") into temp
set the itemdel to "|"
put 0 into tNum
repeat for each line i in temp
add 1 to tNum
--put tNum
put cr & i  after temp1
put "-" into first item of line tNum of temp1
put "-un-" into item 2 of  line tNum of temp1
put 0 into last item of line tNum of temp1
put 0 into item -2 of  line tNum of temp1
put 0 into item -3 of  line tNum of temp1
put 0 into item -4 of  line tNum of temp1
put 0 into item -5 of  line tNum of temp1
end repeat
put temp1 into url ("file:./file2.txt")
end startup
-- 
____________________
Regards, Andu Novac



More information about the metacard mailing list