in reply to How to re-arrange and edit lines in a text file
Yes, this is a good approach.
Saving the current line into a variable is useful if you want to keep the current line 'as-is'. If you want to get fancy you could also create an intermediate representation of the output in memory (probably as an 'array of arrays') calculate the longest value length for each column and create properly indented columns from scratch.
Just remember: You can't spell 'pretty pointless' without 'pretty'. ;)
|
---|