11-30-2015 09:56 AM
Hi everybody,
I am new with Labview and I would like to copy and paste data from a .txt file to an Excel sheet.
Do you know if there is a link somewhere on the internet to download a version of the "GOOP" Toolkit for Excel that works at least with Labview 2014 ?
This one is too old .... http://www.ni.com/example/27974/en/
Or maybe is there already someone who did a VI that do (or almost) what I want ?
I would like to read a .txt file structured for example like this :
Test Date XXXXXX
Test Stage XXXXX
Repetition XX
Voltage 1 [V] XXXXX
Voltage 2 [V] XXXX
Temp 1 [°C] XXXX
Temp 2 [°C] XXX
Result XXXX
Num 1 X
Num 2 X
Num 3 X
Script Name XXXXX
Script Version XXXXX
And to copy and paste line by line the results (XXX) in the different cells of the first empty line of a specific Excel sheet
Make a screenshots of the table with all the values and titles
Save the picture in a specific folder
Save the Excel sheet...
Thank you for your time and consideration
Cheers
Solved! Go to Solution.
11-30-2015 09:59 AM
If you are running LabVIEW 2014, you should have available the Report Generation Toolkit which implements reading and writing Word, Excel, and HTML "Reports". There are numerous examples included with LabVIEW, plus other examples on the Web and in these Forums (I wrote several of them). They are (fairly) easy to use (assuming you are facile in LabVIEW), reasonably fast, and do most of the "common" things you would want to do.
Bob Schor
12-01-2015 03:56 AM
Hello,
to read the data from your .txt file I recommend you the Read Delimited Speadsheet.vi from the File I/O function palette.
You get the data as an array and to save this data as an Excel file you can use the Report Generation Toolkits. I searched a example for you.
I think you want to save a image of the front panel of your MainVI, here´s a good description how to do this.
http://digital.ni.com/public.nsf/allkb/09FAC3BEE5B9C38B862570EC00698237?OpenDocument
kind regards,
Wolfgang Schmailzl
12-01-2015 04:03 AM
Hi wschmail and Bob_schor,
Thank you for your answers.
wschmail can you send me again the document you sent Excel Report - Conditionally Formatted Spreadsheet.vi 20 KB on a version that can be run with Labview 2014 please ?
For the screenshot it's not exactly what I want to do... as I would like to save a screenshot of my Excel sheet.. I think I will have to do it running a macro in my Excel... but I do not know the code for the macro yet.
12-01-2015 04:14 AM
Hi Neercs,
sure here it is for LabVIEW 2014.
I found a LabVIEW VI to run an Ecxel Makro as well.
Hope I could answer your questions.
Kind regards.
12-01-2015 07:59 AM
These examples, and more, can be found on your own machine. Open LabVIEW, go to Help, Find Examples ..., click the Search Tab, choose Directory Structure, and find Report Generation/Excel Reports. You will find both wschmail's Examples, along with several additional Examples.
Bob Schor
12-01-2015 10:33 AM
Thanks it helped me.
I tried to do something...
Hoewver it doesn't work perfectly. When I try to withdraw the empty/blank lines from my data nothing is changed...
When I want to convert these data into an array of string I just get numbers...
Moreover I do not understand why when I want to get the last empty row, the Labview module takes into account the borders...
If I open an empty sheet in Excel and add borders on a cell the last empty row return the row places after this cell...
Do you have any idea ?
12-01-2015 11:17 AM
I (and I'm sure other Forum participants) would be more than happy to take a look at your code. However, you should not force us to recreate your code from the image that you provide -- you've already done the work, so attach your VI to save us the time and effort. It would also help to attach an example Excel file so we can be sure we understand your bit about "borders" (and maybe figure out how to handle it correctly).
Bob Schor
12-02-2015 02:10 AM
Hi Sorry for that.
Here is the code, an exemple of .txt data and the Excel sheet.
12-02-2015 03:41 AM
I manage to figure out all my issues except one.
Why a 1D array can not be append in an Excel Sheet using Exel Easy Table ? The dimension pf text data has to be 2...