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

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
pdanese
Posts: 7
Joined: 08 Mar 2019 03:14

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

Post 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.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

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

Post 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...
One of my scripts helped you out? Please donate via Paypal

pdanese
Posts: 7
Joined: 08 Mar 2019 03:14

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

Post by pdanese »

Thank you again. Wonderful piece of software (and help).

Post Reply