VMware Cloud Community
esxi1979
Expert
Expert

export-csv : updating the cvs file with auto-update the fileds per the data length & put a grill boder to all cells

Hi,

any option in export-csv : updating the cvs file with auto-update the fileds per the data length & put a grill border to all cells ?

3 Replies
sneddo
Hot Shot
Hot Shot

Ok, so just trying to understand what you want here: Basically you want the exported data to resize columns to fit the content, and have a grid border around cells?

This isn't going to be possible with CSV, as this is just delimited data and contains no markup. You would have to work with Excel to achieve this, and it won't be a simple task unfortunately. You may be able to find an existing script that might do this, e.g. Office Export-XLSX PowerShell generate real Excel XLSX files without Excel and COM

The other option might be to generate a HTML report as this would be easier to structure this way, however it depends very much on what you want to use the file for.

Wh33ly
Hot Shot
Hot Shot

Have a look at Luc's post, that will achieve you to border, auto- resize & filter etc. like sneddo said, CSV is just plain text.

Export-Xlsx, the sequel, and ordered data - LucD notes

esxi1979
Expert
Expert

Thanks you both.. Will give a try...

i Have script in win sch.. So wanted better format than export-cvs gives...

Reply
0 Kudos