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

  • Error in forms configuration 11g

    Hi, I am trying to configure Oracle Forms server 11g on my machine but I am constantly hitting error which I could not understand at all. The funny thing is there is no error in my Forms Configuration wizard. It just hangs there but I know its not do

  • Net value in the Invoice not populated correctly

    Hi friends, The net value in the Invoice is not populated correctly. The sales order unit price is say 100/EA and the qty is 10 and the net value is 1000 Rs. THe invoice is also showing up the unit price and qty similar to the sales order but the net

  • NB200 broadband not turning on in Windows 7

    Hello All, I have installed windows 7 to an NB200-12J netbook and the mobile broadband is not turning on. I have installed all the Toshiba drivers regarding 3G networking in [http://aps2.toshiba-tro.de/wlan/?page=3gdownloads]. When I press the Fn-F8

  • Update EKKO table

    Hi, I have got the requirement to update EKKO table while creating PO. The exact scenario is, I need to update email address based on some condition while creating PO. This is what I have found: When we create PO, the ADRNR field of EKKO would have a

  • UDF to compare two values and Pull another value if equals

    Hi all, I am looking for UDF to perform the following logic, please help me I will have 3 inputs, say field1, fields2, field3. If field1 = field2 then return field3. You may say that this can be implemented by message mapping with IF condition itself