Read from spreadsheet

Hello,
I'm having strange issues trying to read from the following spreadsheet file. I'm using a similar structure for 2 other spreadsheet files and they work perfectly. When I try and use the following VI with the attached data file it just seems to import a load of zeros.
I'm wondering if the issue could be related to the delimiter as the data is not just comma separated values but there seems to be a space directly after the comma i.e. "18.63, 18.23, 17.53" as opposed to "18.63,18.23,17.53".
Can anyone help me with this? I'm just trying to get some temperature sensor data from a datalogger. The data is being written to the spreadsheet continually and I'm just trying to read the most recent value so that I can use it for further calculations.
Thanks in advance,
Barry
Solved!
Go to Solution.
Attachments:
Data 8199 2391 4_22_2015 16_40_38 1.csv ‏14 KB
Read spreadsheet data.vi ‏10 KB

Right click on your indicator and display \codes mode.  You'll see \00 every other character.  Even in normal display, the text doesn't look right with "spaces" between every character.
I think it is somehow encoded as unicode.  I think that is what the \FF\FE at the front of the file signifes.
Excel is probably reading a unicode CSV file okay.  LabVIEW reads it as a straight up "text" file with a bunch of null characters all over the place.
If you use search and replace, to replace the null characters with nothing, it works fine.
See the attached snippet.
Attachments:
Read spreadsheet data.png ‏115 KB

Similar Messages

  • Read from spreadsheet: a way to automatically continue if the file is missing? (Rather than having to push "continue")

    Hi,
    I'm using the "read from spreadsheet file.vi" to read in data from a file that may or may not be present.  The data isn't required - it's optional data; nice to have but not everybody will use it.
    Of course, if the file isn't present, I get an "Error 7 occurred at Open File+.vipen File", and I have the choice of pushing either the "Continue" or "Stop" button.   What I'm wondering is:  is there a way to just have LabVIEW automatically continue if the file is missing?  Perhaps it could alert the user to the missing file, but continue anyway?   Normally I'd handle this by wiring the Error output of the function to an error indicator.  But the "read from spreadsheet file.vi" function doesn't appear to have an error output.
    I think my description of my question is sufficient, but I'm attaching a snippet of my LabVIEW code that shows the read from spreadsheet file function in question, and the error I get when the file is missing.
    Thanks,
    dan
    Solved!
    Go to Solution.
    Attachments:
    labview-read-sprdsht-error.png ‏27 KB

    Dan_the_Clam wrote:
    Why oh why do people hate them so much!  I'm a friend of local variables! 
    1. They use more memory
    2. They require something on the front panel (even if hidden).  So that is yet another copy of your data
    3. They break data flow
    4. RACE CONDITIONS!!!
    Dan_the_Clam wrote:
    my code evolves and tends to sprawl a bit.
    That tells me you do not have a good architecture to begin with.  It also tells me you need to modularize your code more and use subVIs.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Read From Spreadsheet File help

    I am saving all my data to a text file (See attached file). The problem is that when I try and use the Read From Spreadsheet File.vi I am unclear on how to make it show all my data.
    Does anyone know a away for me to read the whole file and display it all at once reather than line by line?
    Solved!
    Go to Solution.
    Attachments:
    test data 1.txt ‏6 KB

     The read from spread sheet Vi has two data outputs : the top right retrieves the whole file as a 2D array, if you leave the "number of rows" input on the left unwired.
    Message Edité par chilly charly le 01-07-2009 11:22 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Read from spreadsheet file

    Hi! I am a beginner labview user and I have a problem reading data from a
    ..xls file. I have written in columns the data that i want to present in a
    waveform graph through labview. I give the path to the Read From Spreadsheet
    File tool and i connect a true constant in the "transpose" terminal. The Run
    button shows me no error but all I get in my waveform graph is a x-axis
    line. Could someone help me? Thanx

    You say that you want to read data from a .xls file. You use Read From Spreadsheet File to get the data into LV.
    You have mixed some things. A .xls file is NOT a spreadsheet file. It is a file which could be read by MS Excel and some other tools which have import filters for this file. Read from Spreadsheet File is not such a filter.
    A spreadsheet file in the context of LV is a text file where the cells of a row are separeted by a tab and the rows are separated by a end of line.
    A save thing is use Active-X automation to communicate with MS Excel. Let it load the file and read out the cells. The are examples in LV help and in the dev zone. You must have installed and licenced MS Ecxel on your target machine. Maybe someone has written such a fil
    ter for LV but I don't know it.
    The other way will only work if you use US local settings and the data is in one worksheet. Save the file with the extention .txt. So Excel will generate a text file of the correct format. Excel will use the regional settings of your machine. You can read in this file with Read From Spreadsheet File. Unfortunatly this will use fixed settings which are the same as for US regional settings.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Wiring write to spreadsheet.vi to read from spreadsheet.vi and plot the data

    I need to plot the data file from the two 'write to spreadsheet.vi' into a graph. Does anyone know how should I connect the 'read from spreadsheet.vi' so that I can plot my data?
    Please refer to the snippets.
    Thanks.
    Attachments:
    read from spreadsheet.png ‏31 KB

    Hi Lynn,
    You're asking the very same question that I've been wondering about because I don't have the time info. I've found an example that have both info, temperature and time in two colums in one file..it uses two Index Array for time and temp, use the bundle feature, display the plot in an XY graph. So, that was an easy one, but apparently my case is different.
    I've a program that collected the data from simulated signals and it is plotted in a waveform graph against time (amplitude vs time), and a power spectrum (amplitude vs frequency). But the data that I collected are the RMS values and power spectrum amplitude...so, I'm not sure where the time data go. I need to figure this out.

  • How to read two text files using the Read from spreadsheet.vi and then plot it

    I need to read two text files using the read from spreadsheet function and then plot these files over time.
    The file with the .res extention is the RMS values (dt and df) and the second file contains the amplitude of a frequency spectrum.
    I really appreciate any help..thanks
    Attachments:
    RMS.txt ‏1 KB
    FREQUENCY.txt ‏1 KB

    From NI Example Finder:
    Write to Text File.vi
    Read from Text File.vi
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp

  • Generate digital waveform form a read from spreadsheet.vi

    Hi, I'm very new to LabView and am having some problems in completing what I believed would be a very simple task.
    I am using the Read from Spreadsheet.vi to read in an Ascii tab delimited file that I created in Matlab (the file is simple a vector of 1's and 0's that represent a binary stream) All that I want to do is take the output from this and generate a digital waveform corresponding to the 1's and 0's in the array but I cannot find a way of doing this.....
    Help much appreciated,
    Thanks.

    You should be able to just run your data straight  in to the digital write function as long as you select the correct port width of your hardware.
    If you want to do it with a digital waveform it's a bit trickier, the digital waveform data type is a surprisingly complex animal.
    There might be a better way to do it, but this is what I've had to do in the past...
    The "build digital data" function needs a 2D array in, so convert your 1D array into a 2D.
    Then the digital data can be input into a Build Digital Waveform.
    Then the digital waveform can be output with the write digital waveform.
    Message Edited by Troy K on 03-23-2008 11:37 AM
    Troy
    CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
    I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
    Beware of the man who won't be bothered with details. - William Feather
    The greatest of faults is to be conscious of none. - Thomas Carlyle
    Attachments:
    array_to_digital1.png ‏4 KB
    array_to_digital.png ‏9 KB

  • Read from spreadsheet function help

    Hi
    I have 2 csv files, each with like say 10 rows of numbers in column 1 only.   So its a 10x1 matrix.  I want to plot them using the read from spreadsheet functions (I created two Read from SS icons, each read in numbers from the two csv files.. have transpose to always true... index set to -1 to read whole file).  But the output of that returns a 2d array.  And I have trouble moving forward from that point.  I tried to change the output array dimension from 2 to 1.  Then link up the two 1d arrays to a bundle, then to xy graph.  That didnt work.  Can someone give me a hint on how to move forward from that? 
    And is there a big difference between the xy graphs and the waveform graphs?
    Thanks a lot in advance.
    Jerry

    If you have transpose set to true, then you should just use the first row output of the Read From Spreadsheet. This is a 1D array. If you still want to use the 2D array output, then use an index array function and get row 0. You'll get a 1D array. If you don't want to set transpose to true, then use an index array and get column 0. The attachment shows the three different ways. They all produce the same graph.
    The difference between a waveform graph and an XY graph is that the waveform graph displays evenly sampled data and the XY graph can display unevenly sampled data. When you create data for a waveform graph, you provide a y array, a t0, and a dt. With an XY graph, you provide a y array and an X array that may or may not contain unevenly spaced points.
    Attachments:
    Files to XY.JPG ‏27 KB

  • Error in Reading from spreadsheet tool

    Hi all, 
    In my application I am using a Read from spreadsheet function to display the contents of a txt file saved in my computer continuously every 3 mins. This txt file gets updated once approximately every 3 minutes. Now the problem which I am facing is, If the txt files is getting updated at the exact time when the vi is trying to open the txt file it gives an error saying, "file already open!! Continue or Stop" If I press Continue it misses the values from the file. Is there any alternative to avoid this happening. It happens only once or twice in an hour. But still this error becomes fatal as there is a data loss.
    Can anyone please help find a way to avoid this error.
    Regards,
    Nitz 

    Hi Nitzz,
    If you are accessing the same file frequently in two different places then access it using the low level file IO functions.
    Open the file reference at start and keep that in memry using global variable or functional global then close the same at the end of the application.

  • 求助: 如何使用write to spreadsheet file.vi 和 read from spreadsheet file.vi, 并且如何定义它们的路径???

    请问如何使用write to spreadsheet file.vi 和 read from spreadsheet file.vi,我知道spreadsheet file.vi只支持.txt文件,但我应该在哪里设置它们的路径呢,请各位帮忙指点,能不能具体说明下,谢谢...

    write to spreadsheet file.vi 和 read from spreadsheet file.vi,支持.xls文件.
    可以在path处设置它们的路径.

  • EOF detection in "Read From Spreadsheet File"

    Hi folks, I need help in detecting EOF in a "Read From Spreadsheet File". I' d like to stop a while loop by wiring the EOF? indicator to the stop condition, but this doesn't work. For design resons I can't substitute the while loop with a for loop and I DO need the while loop. I read something about creating custom EOF detection but I'm wondering why the builtin function in the vi doesn' t work and if there isn't some simple solution. Many thanks, hazibuli  

    I'm guessing that you want to process one line at a time from the spreadsheet.  Use Read From Spreadsheet File to read in the entire spreadsheet as Dennis says.  Then wire the 2D output to a For Loop with indexing enabled.  Each iteration of the For Loop will allow you to process one line at a time.  When the last line is processed, the For Loop will exit automatically.  Here is an example to get string length of each element in a spreadsheet. Message Edited by tbob on 03-15-2010 09:46 AM

  • For Mike Porter: Read from Spreadsheet File.vi" function

    On 2/17/03 you answered my question about reading and viewing a test done last week back into Labview. I can open the "Read from Spreadsheet File.VI" in Labview and read the file "data.txt" into the VI. The data comes back into the rows & cells on the VI screen but I don't know how to open the graph to see the data as curves. I can see about a 3 x 4 array of cells at a time and the correct data is there but I want to plot it. Do I need to create a new block diagram and VI? I apologize for the vagueness of my question - I'm new at Labview.
    Attachments:
    DATA2.TXT ‏183 KB

    Create a VI with a Waveform Graph on the front panel. On the block diagram, insert a Read From Spreadsheet File function. Connect the All Rows output to the Waveform Graph.
    Attachments:
    Graph.jpg ‏3 KB

  • Format precision apparently ignored when using read from spreadsheet file

    I hope there is ridiculously simple solution to this problem but so far I can't find it. Using the Read from Spreadsheet File function in LabVIEW7.1, I can't get the floating point format (%f) to work; the decimal (%d) seems to work fine. For example, the first value in the attached file is 399.5853. When I read it in using %.2f format I would think I should get 399.58 but instead I get 399.58529663... Oddly if I use %d as the format, I get an as expected value of 399. Can anyone see what I am missing?
    Attachments:
    ReadFileTEST.vi ‏23 KB
    test.txt ‏1 KB

    The solution to the problem is the internal representation of floating point numbers: with a limited number of bytes only a limited number of the (infinitely many) real numbers can be represented. The nearest representable number to 399.5853 is 399.58529663 if the so-called single precision representation (abbr. SGL in Labview) is used.
    It seems that (ridiculously!) NI has chosen to use SGL as the data format in the Read from Spreadsheet VI which causes the unexpected behaviour you observed.
    You can change the representation from SGL (which uses 4 bytes) to DBL (double precision, using 8 bytes) in the Read from Spreadsheet VI and you will observe a better approximation then, but still not 'exact' since the number now reads 399.585300000000018. (With t
    he EXT representation, 10 bytes, you could go to even higher precision)
    I hope someone from NI reads this and they fix the unnecessary limitation of the precision in the Read from Spreadsheet VI.

  • Formating Data for Read from Spreadsheet

    Hello,
    I am trying to read data with the function Read from Spreadsheet. Can I do this with a file in Excel? I saved it as a .csv file, both tab and comma delimited and neither work. Does this function truely read from a spreadsheet, or does it need to be a text file? What is the correct format for this data?
    Thank you!
    Attachments:
    bridge_data_1.csv ‏16 KB
    read_spsheet.vi ‏73 KB

    You need to set the "delimiter" input of the Read from Spreadsheet vi. Wire a string constant with a comma in it and you should be fine. A .csv file is really just a text file anyway.
    The other problem that I saw was that you set the "transpose" input to true, this caused the data to be stored in the array across two rows, when your code was looking for it to be down the two columns. Change that boolean to false and you should be all set, it works on this end at least.
    I hope this helps. Let us know if it doesn't!
    Brian

  • Read From Spreadsheet File.vi in windows 7

    Hi,
    I use Read From Spreadsheet File.vi in windows 7 to read a table, but when it executes, i get a dialogue box asking for the filename, (The box is properly wired to the path).
    However, when i execute exactly the same programme in windows Xp it works with no problem.
    ¿Any known issues with this vi and xindows 7?
    I am using labview 8.6.
    Thanks for your help.

    I am using a relative path as shown in the figure, files are user1.xls user2.xls .... they all exist.
    I have build the program and instaled on other xp machine, it works. Then installed in a win 7 machine and is not working.
    Maybe there is a problem with ..\..\?
    Any other way to go to a parent folder not using ..\ ?
    Thanks for you help
    Attachments:
    ejemplo.JPG ‏8 KB

  • Read from spreadsheet doesn't get all the columns

    Dear users and moderator,
    I am trying to get data out of a text file delimited by tabs. I would like to transfer the data into a 2D array with the "Read From Spreadsheet File" VI but it seems that only the first column is acquired.
    I double-checked and the delimiter is fine. I also tryed to change the format but no effects.
    Does anybody have an idea about the problem?
    Thanks a lot and all the best,
    Andrea
    Solved!
    Go to Solution.
    Attachments:
    GetData.VI ‏11 KB
    DATA.txt ‏2 KB

    Hey Andrea,
    like SumTumWong and billko recommended, just disconnect the tab limiter constant from the "Read From Spreadsheet File" VI to get your programm running. I receive the correct data, if I don't use the constant.
    If you want to set the tab limiter by hand, right click the string constant and choose "'\' Codes Display". After that, enter "\t" into the constant again and your programm will also work like you want.
    Regards, Stephan
    Attachments:
    Read_From_Spreadsheet_File_result.png ‏11 KB

Maybe you are looking for

  • Purchase to Order Scenario - Partial Confirmation Issue

    Hello Team, We are using Item Category with Purchase to Order Scenario. When the Sales Order is booked, Purchase Requisition is Created. Sales Order Line is linked to the Purchase Requision/Purchase Order. In this scenario, we are getting confirmatio

  • Vendor and Customer initial upload in SAP

    Dear All, When I upload vendor opening balance to SAP, my upload account and vendor accounts are updated correctly. Total no of vendor 450 But in vendor recon account (GL Account), its creating 450 line items for vendors. Can i bring it as one line i

  • Safari without flash works on iPad but not on mac

    I decided to remove flash from my mac, because I have found that a lack of flash really wasnt causing me any major problems on my ipad. However, when I access some sites, like this one.....  http://www.dailyfrail.com  on my ipad the embedded video wo

  • Copy movie to a DVD

    How do I copy a movie I to a DVD on my MacBook

  • VBA Function with Range Argument passed to Excel Solver

    I set up a function to run solver with some specific cells but solver seems not to receive the inputs. I consider the arguments as ranges passed by ByVal and ByRef with no success. The solver has already been done directly in the spreadsheet so the p