Sign in to follow this  
Followers 0
msmou

Send output to a log file

4 posts in this topic

Help Needed:

i compared two files using TextFileCompare. The code is

$aFileCompare = TextFileCompare("E:\abc.txt", "E:\abc1.txt")

_ArrayDisplay($aFileCompare)

Func TextFileCompare($sFile1, $sFile2)

If Not FileExists($sFile1) Or Not FileExists($sFile2) Then Return

MsgBox(4096,"","not Matched!",3)

my prblem is:i am comapring if both file exists or not.If not then prompt a msg box.Instead of prompting msg i want to send the output to a log file

How to do it.

Share this post


Link to post
Share on other sites



Use _FileWriteLog (adds date & time to the log file) or simply FileWriteLine.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks.

I used _FileWriteLog

the code is:

#include <Array.au3>

#include <File.au3>

#include <File.au3>

$sLogPath = "E:FileLog.txt"

$aFileCompare = TextFileCompare("E:abc.txt", "E:abc1.txt")

_ArrayDisplay($aFileCompare)

Func TextFileCompare($sFile1, $sFile2)

If Not FileExists($sFile1) Then

_FileWriteLog($sLogPath, $sFile1)

If Not FileExists($sFile2) Then

_FileWriteLog($sLogPath, $sFile2)

EndIf

EndIf

End Func

It is working now

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