Overview
This VI is a good example of parsing an input string to take out comments in a script. When you are processing text inputs, whether from a script or a command line, this can be helpful.
Description
This VI takes data in multiple lines of text, separated by end of line characters. It parses them and places comments into one array and commands in another. In this case, we use the # to denote a comment, and leftover lines are interpreted as commands (see picture of front panel below).
This can be used in programs where scripts are parsed. Similar algorithms are used by consoles of many video games to separate commands from chats.
Steps to Implement or Execute Code
- Download
- Type commands and comments into string control, separated by hitting the enter key
- Run to watch the program sort the lines of text into two arrays
Requirements
Software
LabVIEW 8.2 or later
Hardware
Just your computer
Front Panel

VI Snippet

**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit this discussion thread**