03-30-2016 03:00 AM
hi , i want to use a listBox to display information from file ,so i use a control file path and ListBox , but there a problem , that when i enter as a file path a .txt or texte word , it sent an error.
03-30-2016 03:18 AM - edited 03-30-2016 03:22 AM
ListFolder.vi returns a list of all the folders and files within the folder you pass to it through the path input. If you connect a path to a specific file to it, it won't work, because you need to pass a path to a folder. If you want to read the list from the file you need to use the read from text file vi and parse the string in the file.
03-30-2016 03:26 AM
First a bit of etiquette:
Please don't post files in a propriatary format. Word documents are suceptable to contaning malicious things and you need MS office to see them. Simply post a *.png created from the snipping tool.
Then, The error you are getting is because you passed a file name into List Folder- This is normal. List Folder "Returns two arrays of strings listing the names of all files and folders found in path, filtering both arrays based upon pattern and filtering the filenames array based upon the specified datalog type" Look it up in the help file. Instead select a folder. to use that function correctly.
However, it sounds like you want to read the contents of a file. There are a few options depending on how the file data is structured and how the elements are delimited. Can you post an example of the text file?