Jump to content
Software FX Community

PowerGadgets Creator and CSVfiles


GlennF

Recommended Posts

Hi

I have a csv file in the following format (1.txt) :

Type,Units,Total,,TTL,"76  ","48465  "A1,"6 ","2155 "A2,"12  ","7348 "O,"3 ","3283 "F,"53  ","33268  "I,"2 ","2411 "M1,"0 ","0   "M2,"493 ","346959 "

If I do , import-csv "c:\1.txt" | out-chart -values Units, Total -Label Type on the PS command line, it produced the chart as expected.

However, if I use the Powershell Creator : Choose the 'Chart' gadget, "Use windows Powershell", and type import-csv "c:\1.txt" and click on test the results are displayed correctly. If I then click on finsh, the chart displays "No Data Available". If I click on the 'Adjust Data to Chart" option, the columns are listed, but the data types are all set to System.String and cannot be changed.

At the command line, powergadgets is able to perform the conversion of the strings to numeric, but in PG Creator I don't have the option to do this. How do I adjust the datatype and get the data displayed in PowerGadgets Creator ? Is it possible to create a .pgf file from the command line and then import it into the PG Creator to modify the settings ?

Thanks

Link to comment
Share on other sites

Try using scriptblocks to load the values:

http://community.softwarefx.com/blogs/powergadgets_team_blog/archive/2007/02/23/Connecting-to-CSV-data-from-PowerGadgets.aspx

In the end, having the quotes around the numerical values, could cause an issue at first glance.

You want strings to simply be VALUE, yet numerical values to be represented as "NUMBER".  The simple fact that you're quoting the numerical values would have led me to think PowerShell/PowerGadgets would have forced this to be recongnized as a string, but I guess I'm wrong.

WorkOnChartPrint.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...