Example Code

Read a Text File From an Offset Position 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

Overview

This example reads text from a text file using a given offset. It also outputs a Number which represents the sub string given, after a char match, in the text which was read before 

 

Description

This example shows how to specify a location in a text file, to begin reading from. The offset if specified by the number of bytes, from the beginning of the file.The default values used in this example will locate the second piece of data from the text file. In the block diagram, you will need to play around with the input values to the 'Set File Position VI' and 'Read From Text File VI' to find a different position in the file and read a different size of data.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

1. Download both the VI and the text file

2. Select the file path  

3. Run the VI

 

Additional Information or ReferencesRead From Offset Position LV2012 NI Verified BD.jpg **This document has been updated to meet the current required format for the NI Code Exchange.**

 

 

 

 

 


 

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