Jump to content
Sign in to follow this  
AvN

log file

Recommended Posts

AvN

Hi there,

Quick question:

I am trying to come up with a script that read some data and create a txt log file for that.

Say I have to read $temp1, $temp2,Temp3 from the script. How can I send it to the log file so that I can have it like this:

Temperature1| Temperature2|Temperature3|

$temp1 | $Temp2 |$Temp3 |

With temperature1,2,3 being the title for each column and $temp1,2,3 being the values read.

I tried this but I can't go far.

_FileWriteLog($logFile,$Temp1)

Your help is needed (a bit urgent !!! sorry.)

Thank you.

Share this post


Link to post
Share on other sites
omikron48

$file = FileOpen($logFile, 2) ;use 1 to append
FileWriteLine($file, "Temperature1| Temperature2|Temperature3|")
FileWriteLine($file, $temp1 & "|" & $temp2  & "|" & $temp2 & "|")
;use FileWrite or FileWriteLine to write any other entries here
FileClose($file)

Edited by omikron48

Share this post


Link to post
Share on other sites
AvN

Thank you, this helps.

AvN

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  

×