File Statistics

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
User avatar
pmike
Member
Member
Posts: 36
Joined: 2004 Apr 14, 13:25

File Statistics

Post by pmike »

from another whiny user :?

How hard would it be to,
in some future version of x2,
generate statistics (chars, words, lines) for all selected text files.

editor2 does this currently for single files.
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Can you discuss why this would be important for a file manager?
(It seems to me more in the domain of editor/viewer apps -- perhaps for an enhanced, multi-threaded Editor² ;) )
User avatar
nikos
Site Admin
Site Admin
Posts: 15806
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

what you need is a command line app like wc that you can call from x2 on the selection. I don't know whether there's one for windows but a google will tell it like it is!
User avatar
JRz
Gold Member
Gold Member
Posts: 560
Joined: 2003 Jun 10, 23:19
Location: NL

Post by JRz »

nikos wrote:what you need is a command line app like wc that you can call from x2 on the selection. I don't know whether there's one for windows but a google will tell it like it is!
You should try the cygwin implementation for win32 (http://www.cygwin.com)

It provides all command line tools from the Unix environment for use in a Windows environment. A must have for real scripting!! (and of course includes the wordcount app wc :) )
Dumb questions are the ones that are never asked :turn:
User avatar
pmike
Member
Member
Posts: 36
Joined: 2004 Apr 14, 13:25

Post by pmike »

I currently use the cygwin (open source unix tools for windows) 'wc':

At shell:
> find . -name "*.java" | xargs wc -l

The above command finds all java files in the current directory tree, but it has trouble if any of the directory names contain a space.

Therefore, I tried creating a user command like this:

$ c:\cygwin\bin\wc $A

But this fails when there are too many files selected (100+ in a scrap frame, which is not a really large project).
Robert2
Gold Member
Gold Member
Posts: 673
Joined: 2004 Jun 17, 15:39

Re: File Statistics

Post by Robert2 »

pmike wrote:from another whiny user :?

How hard would it be to,
in some future version of x2,
generate statistics (chars, words, lines) for all selected text files.

editor2 does this currently for single files.
Greetings--
You might want to have a look at this program:

"Translator's Abacus is a FREE word count program developed by GlobalRendering. Just drag and drop files to be counted to Translator's Abacus and a Word Count Report will be presented. "

http://www.globalrendering.com/download.html

You will also find free DOS word count utilities at

http://www.xs4all.nl/~ferguson/dosfilt.html
User avatar
nikos
Site Admin
Site Admin
Posts: 15806
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

this fails when there are too many files selected
you must have reached some sort of command line length limit for this tool. But if instead of $A you use $a (the 8.3 equivalent) you'll be able to push more names in for the same limit
User avatar
JRz
Gold Member
Gold Member
Posts: 560
Joined: 2003 Jun 10, 23:19
Location: NL

Post by JRz »

pmike wrote:$ c:\cygwin\bin\wc $A

But this fails when there are too many files selected (100+ in a scrap frame, which is not a really large project).
nikos wrote:you must have reached some sort of command line length limit for this tool. But if instead of $A you use $a (the 8.3 equivalent) you'll be able to push more names in for the same limit
Hmmm, this is a problem indeed, but no easy way to get around it. What Nikos suggests may help a little, but somewhere there's the limit. It's even worse when you use scrap containers, because then you have to use $a (or $A), because the program won't be ablt to find the files when using $s (or $S for long filenames).
You can use $S when in a normal pane. This uses only the filename, without the path. This will allow for a lot more files to be handles this way.
Dumb questions are the ones that are never asked :turn:
Robert2
Gold Member
Gold Member
Posts: 673
Joined: 2004 Jun 17, 15:39

Re: File Statistics

Post by Robert2 »

Greetings--
With the shareware TextPad editor (http://www.textpad.com), you can do searches through files if you build a file containing a list of these file names, one per line.
The search can be done with Unix Regular Expressions. You can search for about anything.
Robert2
Gold Member
Gold Member
Posts: 673
Joined: 2004 Jun 17, 15:39

Re: File Statistics

Post by Robert2 »

Greetings--
You might want to have a look at "Harddisk Search & Stats". It is a freeware utility. Here is a description:
"You can specify as many search terms you want, and there is no limit to the number of file types you can add for searching."

http://www.freebyte.com/harddisk_search_and_stats
Post Reply