Example Code

Concatenating Multiple Text Files in a Spreadsheet 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
  • Other

Code and Documents

Attachment

Overview

Sometimes, you get given data as lots of little files, and you want to join them all together in one big spreadsheet for analysis. This VI allows you to do that.

 

Description

The best way of getting all your data in one file is to put it there immediately when it's generated. However, not everyone adheres to best practices for data control, so sometimes you can be given large numbers of smaller files, perhaps from different test runs, and asked to join them all up in to one file.

 

This VI will open and read data from multiple ASCII files and concatenate the numbers in to a spreadsheet. It assumes that each file has the same set of rows and columns, and that you just want to add each one in below the last: if you wanted to change this behavior, it could be done by modifying the constants being inputted to the concatenate strings function.

 

Requirements

  • LabVIEW 2013 (or compatible)
  • Microsoft Excel(or similar)

 

Steps to Implement or Execute Code

  1. Download the attached VI.
  2. Create a blank .xls spreadsheet to save your data to
  3. Run the code
  4. Select the files you want to concatenate in the first file dialog
  5. Select your spreadsheet in the second file dialog. 

 

Additional Information or References

VI Block Diagram

 2-294.png

 

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

 

Chiara A
Applications Engineer with NI UK & Ireland

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

Comments
PhaniChillara
Member
Member
on

can you please upload the file in previous version?

phani srikanth
chiara.a
NI Employee (retired)
on

Hi Phanisri - what version of LabVIEW would you like me to add a version of this VI for?

Chiara A
Applications Engineer with NI UK & Ireland
depme
Member
Member
on

How can I concatenate multiple tab-limited text files containing Date, Time, Failure Status information into one spreadsheet file & then plot a graph?