From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Remove Characters from Text File to Give Raw Data

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 example code removes extra characters within a text file to yield only the raw, usable data.


Description

This VI reads in data from a text file and uses the Search and Replace String.vi to remove unwanted characters by replacing them with (" ").  For instance, in the example text file below, the +, leading 0's and U1 were removed.  The values to be removed can be changed within the string constant.


Requirements: LabVIEW 2012 (or compatible). Hardware: none.


Steps to Implement or Execute Code:

1. Create or choose txt file to use.
2. Run the VI.
3. Select this txt.
4. Write down the result from Resulting String.


Additional Information or References: 

 

Remove Characters from Text File to Give Raw Data FP.png

 

Remove Characters from Text File to Give Raw Data sn.png


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

Cheers,
Kelly R.
Applications Engineer
National Instruments

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