Sign in to follow this  
Followers 0
hacksawbob

Bug in _FileCountLines? reading log files

8 posts in this topic

(Noob alert) Hi there trying to cut my teeth on v3 after a while on V2 cant seem to get this _FileCountLines to work correctly when I run it on an 2000 servers backup logs I get There are -245 lines in the file, if I copy the contents over to c:\test.txt it is correct (4 lines)

#include <file.au3>

$CountLines = _FileCountLines("C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\backup04.log")

MsgBox(64, "LOG","There are " & $CountLines & " Lines in the file")

$CountLines = _FileCountLines("C:\test.txt")

MsgBox(64, "LOG","There are " & $CountLines & " Lines in the file")

the log file contains:

Backup Status

Removable Storage did not mount the requested media. The operation was aborted.

----------------------

Share this post


Link to post
Share on other sites



Hi,

Check your backup04.log and see if it is containing @CR @LF at the end

of each line.

Andre


What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Ok I give in how do I do that, I have opened it with crimson editor and used show line break, each line has one. Is there another way to get this info?

Edited by hacksawbob

Share this post


Link to post
Share on other sites

I think the issue is that the .log files are unicode text file format and they need to be ansi...

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Right got it I will redirect the 'type' DOS command to a text file and alter that.

Thanks any way I'll probably be along in a bit with more Q's!

Edited by hacksawbob

Share this post


Link to post
Share on other sites

Right got it I will redirect the 'type' DOS command to a text file and alter that.

Thanks any way I'll probably be along in a bit with more Q's!

How do you mean? I'm having the same problem.


Keith Davis

MCSA, ZCE, A+, N+

http://www.laurinkeithdavis.com

Share this post


Link to post
Share on other sites

I think the issue is that the .log files are unicode text file format and they need to be ansi...

I get the same with any type of file, I've even tried text files.......

It always returns a negative

Share this post


Link to post
Share on other sites

I get the same with any type of file, I've even tried text files.......

It always returns a negative

Provide a .txt file your using... and the script your trying to make it work with... and maybe we can help you.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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