LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Searching for Specified Data, Displaying Full Row from Excel

Solved!
Go to solution

Hello,

 

So I currently have a program that will search a pre-existing excel document (.csv) for a specified carrier number (cell value x). Once it finds the most recent carrier number it will display the part number associated with said carrier. I want to modify my code to allow me to search for the carrier number, and display the entire row (associated with that number. So say I search for carrier number in Column B, instead of just displaying the part number in Column E, I want to display the Row the data is located (A1:E1). Whether as a string or an array, I am just not sure how to go about setting it up. 

 

I attached the VI I currently have as a mock up that ONLY searches for the part number. To run the VI you'll need to change the Path to save dialog in the VI front panel. 

Download All
0 Kudos
Message 1 of 11
(2,002 Views)

If someone needs an earlier version of the labview vi, just lmk and I will save it as a previous version. 

0 Kudos
Message 2 of 11
(1,997 Views)

How about something like this?

 

Screenshot 2023-05-03 075254.png

 

========================
=== Engineer Ambiguously ===
========================
Message 3 of 11
(1,981 Views)

@paintman wrote:

Hello,

 

So I currently have a program that will search a pre-existing excel document (.csv) for a specified carrier number (cell value x). Once it finds the most recent carrier number it will display the part number associated with said carrier. I want to modify my code to allow me to search for the carrier number, and display the entire row (associated with that number. So say I search for carrier number in Column B, instead of just displaying the part number in Column E, I want to display the Row the data is located (A1:E1). Whether as a string or an array, I am just not sure how to go about setting it up. 

 

I attached the VI I currently have as a mock up that ONLY searches for the part number. To run the VI you'll need to change the Path to save dialog in the VI front panel. 


Hello Paintman,

 

If the file is of .csv (not excel) I recommend you use read delimited file and read all data.

 

If you still want to handle with excel, you can use as array (2D Array) and extract data using Array functions,

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 4 of 11
(1,976 Views)

What array functions are you using in this? 

 

Would I need to place this in my case structure with the file path linked to it? I have never used the file I/O functions before. 

0 Kudos
Message 5 of 11
(1,961 Views)
Solution
Accepted by topic author paintman

@paintman wrote:

What array functions are you using in this? 

 


Here's a snippet of block diagram with the labels turned on

 

Search CSV file.png

 


@paintman wrote:

Would I need to place this in my case structure with the file path linked to it? I have never used the file I/O functions before. 


Basically yes

========================
=== Engineer Ambiguously ===
========================