Page 1 of 1

Parse MacFan.exe output

Posted: 09 Feb 2014 06:30
by darioit
Hello,
I run this program: MacFan.exe
and output is :

Mac/SMC Fan Control for Windows (+ Temp)
AKA MacFan - Controls fans in Intel Macs, monitors temperatures
Copyright (C) 2009 Robert Gilliam

Many thanks to:
Davide Ramo
Iam Liuzhong
Lobotomo Software
iStatPro widget

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A copy of the GNU GPL should be in a file called COPYING.txt, found with
the copy of this program

USE OF THIS PROGRAM IS AT YOUR OWN RISK. I AM NOT RESPONSIBLE FOR ANY DAMAGE
CAUSED TO YOUR COMPUTER THROUGH THE USE OF THIS TOOL. AS STATED ABOVE, THIS
PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY.
---------------------------------------------------------------------------

MacFan Version .65 Build 11.3.2009.4

Checking running processes for conflicting programs...

Number of fans in the system: 1

Fan #0 ( ERR ) is currently running at 1535 rpm.
The slowest Fan #0 can run seems to be 1500 rpm.
The fastest Fan #0 can run seems to be 5500 rpm.

Attempting to set your fans to specified speeds.

RPM value for fan #1 not valid or out of safe range [1500,5500].
Setting fan speeds failed. Please contact the developer at sourceforge.net
/macfan for help.


I like to got this words "currently running"

to have this results, plus 0 cr/lf:

1535
0
0
0


Thanks in advance and regards

Re: parse output

Posted: 09 Feb 2014 06:43
by foxidrive
Is this running in a MAC os?

Re: parse output

Posted: 09 Feb 2014 09:18
by darioit
Yes it's running on Mac Mini with windows 7 x86

Re: parse output

Posted: 09 Feb 2014 09:35
by Squashman
So what is stopping you from writing the code?
This is no different then some of your previous batchfiles. Just pipe the output to the find or findstr command and capture the output inside a FOR command.

Re: parse output

Posted: 09 Feb 2014 11:19
by darioit
ok understand the solution, regards


Code: Select all

@echo off
FOR /F "tokens=10*" %%A IN ('MacFan.exe ^| find "running"') DO SET rpm=%%A
echo %rpm%
echo 0
echo 0
echo 0

Re: parse output

Posted: 09 Feb 2014 15:41
by foxidrive
You mean to say that the zeros were just cosmetic? ROFL!

Re: parse output

Posted: 09 Feb 2014 19:35
by Squashman
foxidrive wrote:You mean to say that the zeros were just cosmetic? ROFL!

I know. I laughed at that as well as it was totally irrelevant to the core functionality of the script.

Re: Parse MacFan.exe output

Posted: 10 Feb 2014 08:30
by darioit
I make with this simple script the base for build this graph:

http://oss.oetiker.ch/rrdtool/gallery/index.en.html

Re: Parse MacFan.exe output

Posted: 10 Feb 2014 09:32
by Squashman
darioit wrote:I make with this simple script the base for build this graph:

http://oss.oetiker.ch/rrdtool/gallery/index.en.html

OK. Now you got me interested. I had never heard of RRDTool. How is RRDTool pulling in the data you created from the batch file?

Re: Parse MacFan.exe output

Posted: 10 Feb 2014 15:36
by foxidrive
darioit wrote:I make with this simple script the base for build this graph:

http://oss.oetiker.ch/rrdtool/gallery/index.en.html



There's a whole library of graphs there.