I would like to read several numeric data as well as text data from a .dat-file into a zpl macro to use some of them for further use.
For example, the .dat file has 5 rows and 3 lines, divided by Tabs, e.g.:
Pos1 3.7 4.2 6.2 8.7
Pos2 9.0 7.5 2.8 5.6
Pos3 0.5 1.8 4.6 4.3
Is it possible to use the READ command for reading the complete .dat-file and to select afterwards some special data for further optimization?
Or would it be possible to read only some special data from the .dat-file for further use, e.g. (Row2, Line 2 = 9.0) and (Row3, Line 3 =1.8)?
Best answer by Jeff.WildeView original
It’s easier to read just numeric data, but reading mixed string and numeric values is certainly very doable. Here’s an example using your data set.
Here’s the output:
The ZPL keywords: READ, READNEXT, READSKIP, & READSTRING offer various methods for getting data from files into the ZPL shell.
thanks a lot for your detailed description. That was very helpfull to me.