Page 1 of 1

Column width of report or folderreport

Posted: 28 Feb 2021 20:14
by hermhart
If I wanted to create a visual friendly listing using report() or folderreport(), for each column of data that I want is there any way to set the width of each column without outputting it as a table in an html file for column alignment? Granted I know that may truncate some data in some places.

Re: Column width of report or folderreport

Posted: 28 Feb 2021 20:43
by highend
Not directly but using a one / multiple regexreplace() on the report you've generated would be a viable option

Re: Column width of report or folderreport

Posted: 01 Mar 2021 00:26
by hermhart
Thank you. I will look into that.

Re: Column width of report or folderreport

Posted: 04 Mar 2021 15:16
by highend
A little tool...

Code: Select all

Mandatory args
==============
01. /columns=1:15,3:5 -> <x> = column : <y> = width | , = separator

Optional args
=============
02. /srcFile="a file with full path"
    If the argument is not given, the clipboard will be searched for the separator
    If the separator (and at least one <crlf>) is not found in the clipboard, quit
    If the argument is used but the file does not exist, quit

03. /columnSep=";"
    Default is: "|"

04. /padChar="_"
    Default is: " " (a space)

05. /removeLastSep=1
    Default is: 0
In other words, to format a report that is inside the clipboard (and that is using "|" as the field separator) you'd call it:
columnize.exe /columns=1:40,3:20,4:8
which would set the width limit to 40 for the first column and 20 for the third column, etc.
All other columns are left as they are

It will store that new report in the clipboard...

Re: Column width of report or folderreport

Posted: 05 Mar 2021 14:37
by hermhart
That's awesome, thanks highend. I'm looking forward to testing this out!