Sign in to follow this  
Followers 0
d3mon

Question about ReadFile

4 posts in this topic

Hello,

1.How can I get number of file lines (.txt)

2.How can I read 1st line then 2nd line, etc....

Thanks for any answer !


No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Have you opened the helpfile and looked at the Filexxx Functions before posting here ? muttley

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

1.How can I get number of file lines (.txt)

_FileReadToArray($sFilePath,$aArray)
$iNumLines = $aArray[0]

2.How can I read 1st line then 2nd line, etc....

For $i = 1 To $aArray[0]
$sLine = FileReadLine($sFilePath,$i)
Next

Share this post


Link to post
Share on other sites

2.How can I read 1st line then 2nd line, etc....

For $i = 1 To $aArray[0]
$sLine = FileReadLine($sFilePath,$i)
Next
Just a FYI:Doing a FileOpen() and then the for-next loop using fileread(FileHandle) will perform better.

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0