LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble extracting data from a previously written file

Solved!
Go to solution

I bet we're facing the classic "You can't do an equality check on a floating point" issue in the final loop.  Can you supply an example file?  I'm mostly looking for the order of the file read wavelengths.  Are they sorted in assending order?  If so, then you should be using the Threshold 1D Array with a Round to Nearest to get the index of the power.  But I would really like that example file so I can see where things are going wrong.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 11 of 13
(409 Views)

I was able to have the power be extracted (only after I deleted the header, I didnt understand how to skip it)! I changed the index from 1 to 2 and it worked, I think. Here are the text files, test1.txt is the one I was trying to extract, and eqetest1.txt is hte one I was trying to create with the given data (I dont know if this matters)

 

 

Download All
Message 12 of 13
(404 Views)
Solution
Accepted by topic author MAELV

@MAELV wrote:

I was able to have the power be extracted (only after I deleted the header, I didnt understand how to skip it)! I changed the index from 1 to 2 and it worked, I think. Here are the text files, test1.txt is the one I was trying to extract, and eqetest1.txt is hte one I was trying to create with the given data (I dont know if this matters)


Changing the index worked because there are double tabs.  With a single tab being the delimiter, it makes perfect sense that the power would be all 0s.  I set the delimiter to 2 tabs and it works for me.  I also read the first line of the file first (using the instructions I gave earlier).  I took the liberty of cleaning up some of the code for you.  It should look at a least a little simpler.  I also added an input for the file so I didn't have to keep choosing the file (got a little annoying).  You can reenable the file dialog if you want.

 

Let me know if you have any questions on my code.  I'm about to get out of here, but I will check first thing in the morning.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 13 of 13
(398 Views)