Author Topic: Q: Find in files with a restriction on size?  (Read 569 times)

Bamsen

  • Community Member
  • Posts: 45
  • Hero Points: 1
Q: Find in files with a restriction on size?
« on: January 03, 2018, 12:27:38 pm »
I am using Find In Files to locate notes in small *.txt files.
In those same directories are several large reports and data dumps also in .txt files that takes a long time to process.
Is it possible to restrict Find In Files to only look in files smaller than a given size?
---
Morten A. Steien

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1191
  • Hero Points: 115
Re: Q: Find in files with a restriction on size?
« Reply #1 on: January 03, 2018, 02:38:19 pm »
There is not an option for filtering files based on size.  If the smaller log files have a specific prefix or name associated with them, you can use additional wildcards in the File types filter.  Instead of just *.txt,  you can are allowed:
PREFIX*.txt
or
*SUFFIX.txt
or even
*XYZ*.txt 

I can file a feature request for additional advanced filtering based on file size for consideration in a future release.

jporkkahtc

  • Senior Community Member
  • Posts: 1663
  • Hero Points: 155
  • Text
Re: Q: Find in files with a restriction on size?
« Reply #2 on: January 03, 2018, 06:53:24 pm »
You could also add those specific files by name in the exclusions list, not ideal but it could work if there are a small number of them.

Graeme

  • Senior Community Member
  • Posts: 2176
  • Hero Points: 269
Re: Q: Find in files with a restriction on size?
« Reply #3 on: January 03, 2018, 11:52:18 pm »
You can use the file manager.  File -> file manager -> new file list  - or use the fileman command.  Enter the folder you want to search in.  Slick will create a buffer with a list of all the files.  Right click, select sort - select sort by size in the primary sort.  Untick secondary sort then tick it again to allow secondary sort criteria (looks like a bug?).  Use mouse click and drag, then press the delete key to delete files you don't want to search in.  Then right click, global find - then tick "global" unless you want the search to find one at a time.  Not sure which type of reg expression can be used  - probably slickedit type.  Once the list of files to search in is generated you can re-use it.  You could probably write a macro to do some of this.
 

Bamsen

  • Community Member
  • Posts: 45
  • Hero Points: 1
Re: Q: Find in files with a restriction on size?
« Reply #4 on: January 04, 2018, 06:32:09 am »
Many good suggestions.
Please add a feature request for size.

The files I want to exclude can have any name, but the files I want to find, all (almost) start with 6 digits.
So if I could specify \d{6}.*\.txt that would also be good.
So maybe you can add a feature request to allow regular expression for file names and directories to search.