Page 1 of 1

Empty rows in text file

Posted: Tue Nov 07, 2017 2:57 pm
by Dimix
I have a TI process that reads a text file (in this case a .rux file), and I'm using the following settings:
Capture.PNG
Capture.PNG (7.66 KiB) Viewed 3558 times
The preview indicates that there are empty rows in the text file:
Capture2.PNG
Capture2.PNG (8.14 KiB) Viewed 3558 times
However, empty rows seems to be ignored when processing the file in the MetaData/Data tab. This is problably by design, and for good reasons, ...but...is it possible to set up the TI process so that empty rows are included and read? Don't ask me why I want to do this. :D

Re: Empty rows in text file

Posted: Tue Nov 07, 2017 3:14 pm
by Wim Gielis
That’s by design and known.

What you can do is use the Prolog tab to ExecuteCommand a script to replace the empty lines with something. Then you are ready on time to read in the file tin the following tabs of the process.

Re: Empty rows in text file

Posted: Tue Nov 07, 2017 3:29 pm
by Dimix
Thanks Wim, good idea.

Re: Empty rows in text file

Posted: Tue Nov 07, 2017 3:48 pm
by Wim Gielis
Have script produce its output in a different file than the .RUX file, to avoid problems in that file.

Re: Empty rows in text file

Posted: Tue Nov 14, 2017 10:25 am
by Dimix
Maybe not the most efficient way to do it, but this is the syntax I use. It inserts a '#' for each empty row in the source file, and stores the end result in a new text file.

@(For /F "Tokens=1*Delims=:" %%A In ('FindStr/N "^" %1 '
) Do @If "%%B"=="" (Echo #) Else Echo %%B)>%2