Forum Discussion
Importing an IoT CSV string from USB into a MS Excel Sheet row.
Hello all.
Please, I'd like to count on your help to solve a relevant issue.
I'm using an IoT device to periodically gather numerical info (measurements) from an industrial equipment. I've got to poke these measurements into an Excel Sheet. For every info package, a new row.
This device is easily able to export data to a PC through an USB cable (WiFi is also possible). Data can be delivered as ASCII in CSV or TSV formats. Usually I can trace data consistency via Terminal. It is also possible to create some report by copying the CSV (or TSV) received in Terminal into a text editor file, saving it as .txt, for later acquisition in Excel.
Would there be somehow to do this job as an Excel VBA Macro? I mean the Macro would listen to the USB port, gather the CSV line package and place the values at the first empty row in the Excel Sheet?
If it's feasible, please give me some track. It would be good to have a piece of code, since I've got poor experience on VBA.
Thank you very much.
Regards.
1 Reply
- Yea_SoBronze Contributor
You stated:
This device is easily able to export data to a PC through an USB cable (WiFi is also possible). Data can be delivered as ASCII in CSV or TSV formats. Usually I can trace data consistency via Terminal. It is also possible to create some report by copying the CSV (or TSV) received in Terminal into a text editor file, saving it as .txt, for later acquisition in Excel.
Save it in a folder in the PC, and you can use power query (query by folder), and set the query update time for whatever time you set it as:
cheers