Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Import-CSV | Export-HTML but format issues

$
0
0

You can attach an HTML file if you give it a TXT filename extension.

I’m fine with the CSV being produced elsewhere; you’d said that “I got rid of the #Name? mark from appearing by adding this into the script, but I don’t know why the name of the csv file is appearing or else I’m mistaken.” But I’m not seeing the command you ran where “the name of the CSV file is appearing,” nor the output. When I run the commands I showed you, I’m getting the desired output.

You can also try using the HTML “PRE” tags here in the forums, to format your code. Makes communicating these things a bit more precise.

I think you need to start over a bit. Look at the code I gave you in my previous post. Let’s ignore the formatting for right now – one thing at a time. If you do this:

Get-Content filename.csv | Select -Skip 2 | ConvertFrom-CSV | ConvertTo-HTML -PreContent "HEADING" | Out-String

I put “-Skip 2″ because in your first post, you said the CSV file has a blank line and then the #Name? line, so I want to skip those.

So, does that produce the desired output? Aside from the formatting? Let’s get this working first, and then I can help you with the formatting, I promise.


Viewing all articles
Browse latest Browse all 13067

Trending Articles