LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help to open and look for file by name

Hi,

        Im needing help to open a folder and look for a file (.txt) on this directory by his name ... The user ll type the partial name of file , and i need look for this file on the folder , and delete it ....

How can i look for the file by his name ?

 

 

Thx 😃

0 Kudos
Message 1 of 4
(2,761 Views)

Look at the "Check if File or Folder Exists.vi".  FileIO...Advanced File Functions pallet.

-cb

0 Kudos
Message 2 of 4
(2,757 Views)

That will only tell you if a file exists, assuming the full name is provided. The poster wants to see if a file exists based on a partial name.

 

The question is somewhat ill-formed and incomplete. What if the user types something and there are several matches? What if the user types in just "a"? In this case, how is the program supposed to know which file to delete? Are you intending to provide some sort of filtered view that updates based on the user typing? If that's the case wouldn't it be easier to provide a listbox of all the files in the folder and then have the user select the file to delete?

0 Kudos
Message 3 of 4
(2,739 Views)

Hi ,

 

    Sry ,, let me explain again ... I ll set the name of the files in the follow order ... Name_Serial_date_chanel.sxc ..

The user ll type the serial that he wants delete ...

I already figured out what i need guys .. thx for the help ^^

 

I used List Directory on advanced IO , to list all .. the Name is the same for all ... then i used Name_ concateneted with Serial(typed)* .. this command serial* ll list all serials equal the typed , in my case , ll exist only one , cuz its a count this serial .Then i pass the path to the delete , and its done !

 

Thx ^^

 

0 Kudos
Message 4 of 4
(2,726 Views)