Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Reading text file and charting them via powergadget

Reply
 
Old 03-19-2008   #1 (permalink)
IT Staff


 
 

Reading text file and charting them via powergadget

I've a simple text file eg results.txt

Jan,10
Feb,20
March,30

Assuming i've already created a powergadget template, what is the best way
to read the file and out-chart it ?




My System SpecsSystem Spec
Old 03-19-2008   #2 (permalink)
Thomas Lee


 
 

Re: Reading text file and charting them via powergadget

In message <udpDSbaiIHA.5208@xxxxxx>, IT Staff
<jkklim@xxxxxx> writes
Quote:

>I've a simple text file eg results.txt
>
>Jan,10
>Feb,20
>March,30
>
>Assuming i've already created a powergadget template, what is the best way
>to read the file and out-chart it ?
Something like:

PS: get-content c:\datafile.txt | out-chart <with all your parameters>

--
Thomas Lee
doctordns@xxxxxx
MVP - Admin Frameworks and Security
My System SpecsSystem Spec
Old 03-19-2008   #3 (permalink)
Marco Shaw [MVP]


 
 

Re: Reading text file and charting them via powergadget

IT Staff wrote:
Quote:

> I've a simple text file eg results.txt
>
> Jan,10
> Feb,20
> March,30
>
> Assuming i've already created a powergadget template, what is the best way
> to read the file and out-chart it ?
>
>
>
As-is, you'll need to transform this into objects before PowerGadgets
will understand the input:
get-content results.txt|select-object
@{e={$_.split(',')[0]};n='Month'},@{e={$_.split(',')[1]};n='Total'}

Then pipe that to out-chart.

Otherwise, you need to add a header to your CSV file, then you can use
import-csv to read in the file, and pipe to out-chart.

And to call your template file:
....|out-chart -template "location of your .pgt file"

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Reading A Text File VB Script
Reading text file at a URL VB Script
Reading file names and Searching for text VB Script
Reading a text file with StreamReader .NET General
Refresh on Reading more than one variable from a Text file VB Script


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46