Parse MacFan.exe output

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
darioit
Posts: 230
Joined: 02 Aug 2010 05:25

Parse MacFan.exe output

#1 Post by darioit » 09 Feb 2014 06:30

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

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: parse output

#2 Post by foxidrive » 09 Feb 2014 06:43

Is this running in a MAC os?

darioit
Posts: 230
Joined: 02 Aug 2010 05:25

Re: parse output

#3 Post by darioit » 09 Feb 2014 09:18

Yes it's running on Mac Mini with windows 7 x86

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: parse output

#4 Post by Squashman » 09 Feb 2014 09:35

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.

darioit
Posts: 230
Joined: 02 Aug 2010 05:25

Re: parse output

#5 Post by darioit » 09 Feb 2014 11:19

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

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: parse output

#6 Post by foxidrive » 09 Feb 2014 15:41

You mean to say that the zeros were just cosmetic? ROFL!

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: parse output

#7 Post by Squashman » 09 Feb 2014 19:35

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.

darioit
Posts: 230
Joined: 02 Aug 2010 05:25

Re: Parse MacFan.exe output

#8 Post by darioit » 10 Feb 2014 08:30

I make with this simple script the base for build this graph:

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

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: Parse MacFan.exe output

#9 Post by Squashman » 10 Feb 2014 09:32

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?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Parse MacFan.exe output

#10 Post by foxidrive » 10 Feb 2014 15:36

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.

Post Reply