Jump to content
Software FX Community

Reading a remote CSV


Recommended Posts

- Create a script called ImportCsvWeb.ps1 with the following

$url = $args[0]
$tempFile = [system.IO.Path]::GetTempFileName()
$webClient = new-object System.Net.WebClient
$data = import-csv $tempFile

- Invoke it in a powershell session (or script) as follows

.\importcsvweb.ps1 "http://<your csv file URL>" | out-chart -values <ValueColumns> -label <LabelColumn>

Note that in this case we let ImportCsvWeb to return the data without any "casting" to allow reuse of this script with multiple CSV files. You tell the out-chart cmdlet which fields should be plotted through the -values parameter (which must contain only numbers)


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.

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...