Re: string count in log file
Re: string count in log file
- Subject: Re: string count in log file
- From: Greg Sutherland <email@hidden>
- Date: Fri, 21 Sep 2001 06:28:56 -0400 (EDT)
I thought I was beginning to understand. Wrong. I get a count of 0 every
time. Even when I use the same file which just has one line with one word
I still get a count of zero. :(
I've displayed the values of theText and srchStrng and they look correct.
What am I doing wrong??
greg
AS1.3.7 OS8.6 G3
set theFile to (choose file with prompt "Pick the file to analyze:" of type {"TEXT"})
set fileID to (open for access theFile)
try
set theText to (read fileID)
close access fileID
on error m number n
try
close access fileID
on error
end try
error m number n
end try
set theFile to (choose file with prompt "Pick the file of search strings:" of type {"TEXT"})
set fileID to (open for access theFile)
try
set srchTbl to (read fileID as {text} using delimiter {return})
close access fileID
on error m number n
try
close access fileID
on error
end try
error m number n
end try
set rsltText to ""
set od to AppleScript's text item delimiters
repeat with srchStrng in srchTbl
set AppleScript's text item delimiters to srchStrng
set theCount to (count text items of theText) - 1
set rsltText to rsltText & srchStrng & tab & (theCount as text) & return
end repeat
display dialog rsltText