Text file parsing


I’m parsing a text file of 20k and I’m reading it with cffile read and then looping through the var from the read and then using chr(10) and chr(13) as delimiters for line breaks. Empty lines, white spaces are all significant.

Following are a part of its sample data.
As one can tell, for the top level 1, there’s one white space before its text
for level 2, there are more white spaces before its text. But it seems evaluating the value of mid(#lineVar#,2,1) to see if it’s chr(32) is the way to go, however, it seems white spaces have been removed from the values of #lineVar# .

Using fileOpen read, while not endofline inside a cfscript generated the same result, that is, white spaces have all been stripped away.



Hi @justaguy,

Both Lucee and ACF are working as same.

You may use ‘Settings-Output --> Whitespace management’ in lucee admin & I hope it helps for you.

1 Like

Good to know, thanks.