Page 1 of 1

Custom column for "number of lines" in a CSV or TXT file?

Posted: 10 Mar 2019 02:28
by pdanese
Hi,

I am running a trial version of XYplorer (19.70.0100).

Is there a way to create a custom column that shows the number of rows/lines in a CSV or TXT file?

For example, you can determine the number of lines in a csv file from the command prompt using:

Code: Select all

 findstr /R /N "^" myfile.csv | find /C ":"
, but I am not sure how to incorporate that into XYplorer (or if it's even possible).

The information doesn't necessarily have to be presented in a custom column. If there is a more appropriate way to display this type of metadata in XYplorer that would be great, too.

Thank you.

Re: Custom column for "number of lines" in a CSV or TXT file?

Posted: 10 Mar 2019 05:45
by highend
type snippet; into the address bar, execute that command with the {ENTER} key

Paste this into the edit box of that new window that appears:

Code: Select all

Snip: CustomColumn 1
  XYplorer 19.70.0119, 10.03.2019 05:43:26
Action
  ConfigureColumn
Caption
  Lines
Type
  3
Definition
  return trim(runret("""cmd"" /c findstr /R /N ""^"" ""<cc_item>"" | find /C "":"""), <crlf>);
Format
  0
Trigger
  0
Item Type
  0
Item Filter
  csv;txt
Hit the OK button

Add that new custom column...

Re: Custom column for "number of lines" in a CSV or TXT file?

Posted: 11 Mar 2019 18:58
by pdanese
Thank you again. Wonderful piece of software (and help).