header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

create charts from CSV files
Last Post 12 Dec 2007 03:41 PM by marco.shaw. 7 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
PedUser is Offline
New Member
New Member
Posts:4
Avatar

--
05 Dec 2007 04:02 PM  
Hi all,

I've written a script that allows you to browse for a csv file, it then populates dropdown boxes with the headers, allows you to select values from the list and then output it to powergadgets (it references a template file)
I use this daily for perfmon work and it saves me tons of time.

One issue i have and could use some help on, is when you have charted a file you can't then select a new file and chart it. I need some sort of reset mechanism.

Please excuse any sloppy formating as i'm finding my why around powershell and .net, but i would welcome any ideas for improvement and feedback on where the code could be simplified.

Take a look and let me know what you think.

Cheers

Ped

Attachment: 112562721871.ps1

PedUser is Offline
New Member
New Member
Posts:4
Avatar

--
05 Dec 2007 04:06 PM  
Attachment didn't seem to work.....trying again :-)

Attachment: 1125104246871.txt

DonJUser is Offline
PowerShell MVP
Basic Member
Basic Member
Posts:134
Avatar

--
06 Dec 2007 03:53 PM  
The Web server isn't configured to "serve" PS1 files - since you changed to TXT, it should be fine :).


- Don Jones
www.ConcentratedTech.com
Subscribe (RSS) or visit for weekly PowerShell tips and lessons
DonJUser is Offline
PowerShell MVP
Basic Member
Basic Member
Posts:134
Avatar

--
06 Dec 2007 03:55 PM  
WOW - that's a meaty script! On the whole, I think that's pretty much the way I'd proceed. I might put a bit more in the way of comments in there, since you're doing a LOT with WinForms and it'll be tough to follow six months from now, trust me! This is something you should consider adding to the ScriptVault for permanent storage.


- Don Jones
www.ConcentratedTech.com
Subscribe (RSS) or visit for weekly PowerShell tips and lessons
PedUser is Offline
New Member
New Member
Posts:4
Avatar

--
10 Dec 2007 11:46 AM  
Thanks Don. I will be adding this to the vault after i've tidied it up a bit (and added some comments).

Can anyone help with some sort of reset mechanism? The issue is that once the CSV file headers have been enumerated, you cannot then go back and work on a different file without first closing the GUI and restarting the script.


DonJUser is Offline
PowerShell MVP
Basic Member
Basic Member
Posts:134
Avatar

--
11 Dec 2007 10:58 PM  
You'd want to wrap the whole thing in some kind of loop, then, so that the whole script (essentially) can re-run automatically until the user decided they're done.


- Don Jones
www.ConcentratedTech.com
Subscribe (RSS) or visit for weekly PowerShell tips and lessons
PedUser is Offline
New Member
New Member
Posts:4
Avatar

--
12 Dec 2007 01:08 PM  

Found a way around the reset problem.

I have changed the code so that when the 'choose axis' button is clicked the first thing it does is remove any existing comboboxes before creating the new ones.

This allows you to keep choosing and charting different files without having to restart the script.

I've tidied it up and submited it for the script vault. Hope you find it useful.

Cheers

Ped



marco.shawUser is Offline
Co-Community Director
Basic Member
Basic Member
Posts:188
Avatar

--
12 Dec 2007 03:41 PM  
You should post this in the PowerGadgets Cool Scripts forum also:
http://powergadgets.com/csPg/forums/default.aspx

Mind sharing your template file too?


Marco

*Microsoft MVP - Windows PowerShell: http://www.microsoft.com/mvp
*PowerGadgets MVP: http://www.powergadgets.com/mvp
*Blog: http://marcoshaw.blogspot.com
You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer