Example Code

Acquiring Multiple File Paths from Selected Directory using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview
This example shows how to select multiple files and acquire their file paths interactively from a selected directory. This VI not only allows a user to select files from single directory, it allows files to be loaded from different directories.


Description
This VI is designed to allow the user to choose multiple files and acquire their file paths interactively from different directories. The main VI (Get File Paths 2012 NIVerified.vi) uses the sub VI (Select Files From Directory.vi) to acquire multiple file paths of the files selected by the user. In order to implement this function into a program, the user will simply drop Select Files From Directory.vi on to the block diagram and connect the output terminal. The output of Select Files From Directory.vi is a reference (file path) to the selected files.


Requirements

  • LabVIEW Base Development System 2012 (or compatible)


Steps to Implement or Execute Code

  1. Unzip the attached folder to your computer
  2. Open the VI "Get File Paths 2012 NIVerified.vi"
  3. Run the program.

 

Additional Information or References

File Selection Dialog Box

File Selection Dialog Box.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Regards,

Mike Altmann
Product R&D
NI

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Nicholas_Herrick
Member
Member
on

It would be nice if you could select multiple files at once on the left side of the dialog box and then just move them all over to the right side with one click.

Also, it would be nice if the right side of the dialog would refuse duplicate files, although this might be a problem if there were multiple files with the same name but with different data in them. Maybe you could just add a radio box saying "Refuse Duplicate Filenames" or something like that.

One last thing: there should be a 'Cancel' button.

Otherwise, it seems to work well and it looks good! Nice job and thanks for the handy subVI.

InfiniteNothing
Active Participant
Active Participant
on

FYI, the File Dialog express VI allows mutilple file selection though not from different folders.

CLED (2016)