topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday April 24, 2024, 7:01 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Tally lines of text based on first X characters  (Read 4540 times)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 553
    • View Profile
    • Donate to Member
Tally lines of text based on first X characters
« on: April 01, 2023, 02:04 AM »
Given a text file.  And given that we are interested in the first 20 characters to base a tally on.

How many lines are there for each different first 20 characters?

For instance, in the following:

http://62.182.86.140
http://62.182.86.140
http://62.182.86.140
http://libgenfrialc7
http://libgenfrialc7

There are 3 of http://62.182.86.140
There are 2 of http://libgenfrialc7

Thoughts and help greatly appreciated!

Nicholas Kormanik







publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: Tally lines of text based on first X characters
« Reply #1 on: April 01, 2023, 06:26 AM »
Hi Nick! On the way (with a small GUI) :Thmbsup:

Code @ https://github.com/p...icdomain/tally-lines

Given a text file.  And given that we are interested in the first 20 characters to base a tally on.

How many lines are there for each different first 20 characters?

For instance, in the following:

http://62.182.86.140
http://62.182.86.140
http://62.182.86.140
http://libgenfrialc7
http://libgenfrialc7

There are 3 of http://62.182.86.140
There are 2 of http://libgenfrialc7

Thoughts and help greatly appreciated!

Nicholas Kormanik
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 553
    • View Profile
    • Donate to Member
Re: Tally lines of text based on first X characters
« Reply #2 on: April 02, 2023, 12:48 AM »
Vic, while I have your attention, Flatten is still giving this error message when it encounters long path items:

Flatten Error.pngTally lines of text based on first X characters


publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: Tally lines of text based on first X characters
« Reply #3 on: April 06, 2023, 04:22 PM »
TallyLines is released!


TallyLines_v0-1-0.png



Flatten is still giving this error message when it encounters long path items

Can you please report your experience with this system-wide long path fix:


Enabling the long paths will allow you to get the long path’s files or folders info using System.IO or WMI. If you’re using a Windows 10 machine, then please follow the below-mentioned steps to enable long paths
 
a. Hit the Windows key, type gpeedit.msc and press Enter.
b. Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem > NTFS.
c. Double click the Enable NTFS long paths option and enable it.
 
Image3.png
 
To reflect the changes, update the group policy. After successful group update, WMI or System.IO libraries work for long paths too.

Cheers & many thanks!
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: April 06, 2023, 04:47 PM by publicdomain »

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 553
    • View Profile
    • Donate to Member
Re: Tally lines of text based on first X characters
« Reply #4 on: April 06, 2023, 08:43 PM »
Vic, even with system setting for allow long path, seems individual programs choke.  Individual programs themselves have to allow for long paths.  If they do, and Windows setting is set to allow, then no problem.

An increasing number of programs are allowing/handling long path length.  One example that I often use is TreeSize.  TreeSize, more meant for other uses, at least shows directories and files exceeding 256 characters in length in red, thus allowing one to rename to shorter path, from within TreeSize.  Upon 'refresh' of the folder, the now-shortened path will be in the usual black font.

The problem comes in when you have many, many sub-folders/sub-files.  In TreeSize one would have to search through the long list and individually do the renaming of all the 'red' font folders, could be twenty or thirty, whatever.  A bit of a chore.

As all I care about in my particular case are the actual end files -- example, .mp3 files, or .epub files -- it's really nice to have Flatten that can dump all files into the base folder.  Works great!  EXCEPT when some nested file path exceeds 256.  Then Flatten chokes.


« Last Edit: April 06, 2023, 08:53 PM by nkormanik »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: Tally lines of text based on first X characters
« Reply #5 on: April 10, 2023, 09:48 AM »
Okay, as you already tried the fix, modifying flatten is the way then :Thmbsup:

(On the way! :))
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: Tally lines of text based on first X characters
« Reply #6 on: April 17, 2023, 09:12 AM »
(On the way! :))
-publicdomain (April 10, 2023, 09:48 AM)

FlattenFolderMenu v0.2.0 with long path support via AlphaFS is complete code-wise.

GitHub tag @ https://github.com/publicdomain/flatten-folder-menu/releases/tag/v0.2.0

Proper public release with be done right after luvnbeast's SearchShoftcut.
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com