Flyingbear Posted February 8, 2015 Report Share Posted February 8, 2015 (edited) Dear Everyone, I tried to read data from txt or xls file, but failed. The data from txt were lost with decimal, e.g., my data should be 1.618, but the vi gets 1; The data from xls were more ridiculous, giving 0. Does anyone know what happened? Thank you very much for concern. The Problem with txt has been solved, according to ned´s advice. The labview is expecting 1,61 instead of 1.61, so crazy. But the Problem with xls is still there, nothing could be read out. The files are enclosed, thanks again for attention Open Data File.vi Al2O3.txt Al2O3.xls Edited February 9, 2015 by Flyingbear Quote Link to comment
ThomasGutzler Posted February 9, 2015 Report Share Posted February 9, 2015 Maybe you could attach the file you're reading and the actual vi doing the work? Quote Link to comment
ned Posted February 9, 2015 Report Share Posted February 9, 2015 I'm guessing you have a different decimal separator than what the VI expects, for example you're using a '.' in your file but your operating system is set to use the European ',' Quote Link to comment
crossrulz Posted February 9, 2015 Report Share Posted February 9, 2015 This looks like a localization issue. Yes, please attach a sample file so we can get this figured out for you. Only a couple of lines will be needed. Quote Link to comment
ThomasGutzler Posted February 9, 2015 Report Share Posted February 9, 2015 This can't be right. Did you try fixing that file manually or does it actually mix "," and "." as decimal separators in your txt file? 300 1,70367 301 1,7032 302 1.70275 303 1.70229 Quote Link to comment
ShaunR Posted February 9, 2015 Report Share Posted February 9, 2015 Wire the string "%.;%.5f" (without quotes) to the format terminal. That will change the localisation for the read function to a decimal point regardless of the OS setting (it will truncate the first two entries because they are commas and the rest are decimal point). Read From Spreadsheet File VI doesn't read Excel files, only text files. 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.