If you have the paths in a string, separated by newlines, you can do
var _path_array = string.split("\n");
```to get a array of the paths.
After that you can loop through your array and use the file plugin to read the contents of the files:
for (var i = 0; i < _path_array.length; i++) {
_content = plugins.file.readTXTFile(_path_array[i]);
}
Yes, I have the folowing path:
c:\xml\groups\group1.xml
c:\xml\groups\group2.xml
c:\xml\grups\groups3.xml
…
…
I have another aplicattion (no Servoy), that continuosly generate XML files.
I need read this files to import to my Servoy solution
The path is always the same, only change the name of the fail
When I import the file, I delete the file, which I have the file, group1.xml, group2.xml,…, group15050.xml etc…
I need know how many files there are in the path c:\xml\groups, and read every one and then delete.
var _dir = plugins.file.convertToJSFile("C:/xml/groups/);
var _files = _dir.listFiles();
var _content;
for (var i = 0; i < _files.length; i++) {
_content = plugins.file.readTXTFile(_files[i]);
//do stuff
plugins.file.deleteFile(_files[i]);
}