Example Code

Append a string to file and folder names

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

Overview
This code renames files and folders in a directory by appending a string to the end of them, before the first period, so that the file extension is preserved. 


Description
This code renames files and folders in a directory by appending a string to the end of them, before the first period, so that the file extension is preserved. It also provides a function to undo this change.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

 

  1. Type in the string you wish to append to the entire file structure.
  2. If you want to append the string to sub-folder names, set the Append Folder Names? boolean to True
  3. Run the program.
  4. If you have a need to undo this, leave the Appended String the same and select the 'Undo this mess!' button.

 

Additional Information or References
VI Block Diagram
1.png

 

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

 

 

National Instruments
Staff Certification Engineer

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