Convert Spreadsheet String With Multiple Spaces Instead of Tabs in LabVIEW

Updated Aug 18, 2023

Reported In

Software

  • LabVIEW

Issue Details

My input string is a normal spreadsheet string with rows delimited by newline characters, but rather than tab characters each column is delimited with multiple spaces.  I need to convert this string into an array.

Solution

The easiest solution is to preprocess the string using the Search and Replace String Function.

The Search and Replace String Function is found in the String Functions Palette.
  1. Right click the Search and Replace String Function and select Regular Expression from the shortcut menu.
  2. Wire a string constant containing " +" to the search string input.  This is a regular expression that will match one or more spaces.
  3. Wire a string constant containing a single space to the replace string input.  This will replace each instance of multiple spaces with a single space.
We should now have a spreadsheet string that is simply space delimited, and can be read normally by the usual spreadsheet string functions.