Hi

I'm trying to read through a text file but I need to check if the first
character on each line is a full stop (.)

Any ideas?

Thanks.

Re: reading through a text file checking the first character on each line by DiGiTAL

DiGiTAL
Thu Aug 18 10:09:33 CDT 2005

stext = ofile.readline
if left(trim(stext), 1) = "<the character you are testing for> then
'insert commands to run here
else
'insert other commands here
end if


*** Sent via Developersdex http://www.developersdex.com ***

Re: reading through a text file checking the first character on each line by scriptnovice

scriptnovice
Thu Aug 18 10:28:18 CDT 2005

I've also managed to come up with:

strtext = ofile.readline
firstChar = Left(strtext, 1)
If firstChar = "." Then.....

But I think your way is a little more elegant.

Many thanks.


Re: reading through a text file checking the first character on each line by Al

Al
Thu Aug 18 21:19:19 CDT 2005


"scriptnovice" <tsurf44@hotmail.com> wrote in message
news:1124378898.110014.111260@o13g2000cwo.googlegroups.com...
> I've also managed to come up with:
>
> strtext = ofile.readline
> firstChar = Left(strtext, 1)
> If firstChar = "." Then.....
>
> But I think your way is a little more elegant.

Elegant, perhaps, but...

Depends on what you mean by "first character". Did you mean the first
non-whitespace character, or the first character?

/Al