Convert .csv to .xls using powershell

amaradiswamy
Kilo Sage

Hi All,

I want to convert .csv file attached to a record in a table to .xls in Servicenow. Is there any script to convert this in the powershell activity?

I will be really greatful if any one can help me.

Thanks and regards,

Swamy

5 REPLIES 5

kenappell
Kilo Guru

This is more of a Powershell question than a ServiceNow question. Searching Google results in the following possibility:


How to export a CSV to Excel using Powershell - Stack Overflow



I hope this helps!


Ken


Hi Appell,



Thanks for your reply.



But, how can i specify a path for the attachment in Powershell script when the attachment was added to a record in the table created in Servicenow instance.




Regards,


Swamy


You're best bet is to create a workflow that moves the attachment along to the script. See the following post for dealing with attachments in workflows:


Adding attachments to a workflow notifcation


Gurpreet07
Mega Sage

Hi Amaradi,



Create a datasource of file type csv.Attach file to datasource. Insert data to a table and get xls using url..         <instance_url>.<table_name>_list.do?EXCEL