This can be done using the Split VBS method. This method outputs an array of all segments of a string that are separated with a specific delimiter. In the example given in the Issue Details, the delimiter would be the underscore symbol ("_").
According to the
Split topic in the
DIAdem Help , the syntax is:
Split(expression, [delimiter], [count], [compare])
where expression must be replaced with the file name as a string. Refer to the
Split topic in the
DIAdem Help for more details about the method, as well as an use example in a script.
If you don't want to write a script, but use the method directly in the Report pane in DIAdem, for example, as part of the label of a 2D Axis System, you can enter the method as follows:
@@Split(expression, [delimiter], [count], [compare])(i)@@
where i is the component index. Since the output of the Split method is an array, you need to add an index to extract each value independently. Using the example from the Issue details:
@@Split("DUT_SerialNumber_Date_TestTime", "_", -1, vbTextCompare)(i)@@
would return:
i value | Expression Output |
---|
0 | DUT |
1 | SerialNumber |
2 | Date |
3 | TestTime |
Additional Information
- If you don't want to write the name of the file manually, you can use the Data.Root.Name , Root property , as the expression input of the Split method.
- You can load and unload files to the Data Portal using the DataFileLoad command and the Remove method.
- If you want to repeat the process for multiple files automatically, the easiest method would be creating an array with all the paths, or placing all the files in a single directory and using the DirListGet command, which will return an array of file names from a directory you specify. Then, you can combine it with a for For Each...Next control structure to iterate the process once for every file.