Re: Help with sting compare?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Help with sting compare?
- From: Philippe Lhoste <PhiLho@...>
- Date: 2005年8月19日 01:47:27 +0200
Ron Hudson wrote:
I am reading through a file that has variable length records, records
are separated
with a line containing only the "&". The last line in the file has "&&".
repeat
aline = read.io()
if aline == "&" then
count = count + 1
end
until aline == "&&"
Neither "&" or "&&" are ever detected.
I have checked the file... & and && are the only thing in the line.
I also have ">" .. aline .. "<" printed and see >&<
I don't know what your read.io function is, but I hope it really returns
only one line per call...
Now, perhaps you should also check if the line includes the end-of-line
character(s) (\n, \r or \r\n). If that's the case, trim them off with a
gsub.
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --