I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
Attachments:
try2.txt ‏2 KB
read_array.vi ‏21 KB

The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
Here are some of your choices to fix your problem.
1. Change the source file to a tab delimited file. Your VI will then run as is.
2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

Similar Messages

Maybe you are looking for

  • A free ebook for EJB 3.0 with the latest version of Netbean

    Hi, I am a trainee although with a good background in java. I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected] Again, is container managed bean good fo

  • Change G/L account on WO component

    Hi expert, how to change G/L account on component - gen data/ reservation item detail (item cat: L), the field is grey. pls help. Thanks. rgds.

  • IWeb pages and Firefox

    http://web.mac.com/signedupuy/eslspells.com/Home4.html The following page when loaded in Firefox seems to lose all its formatting while it is fine in Safari and IE. The text of the page is nested in text box so that formatting is maintained but inste

  • How to call procedure which is another database

    I have two procedure1 and procedure2 on two different database1 and database2. I want to call procedure2 inside the procedure1. Can you please give me the steps(including creating DBLink) how can this be done. Thanks

  • What time is firefox 8 going to be released today

    what time today