Some ideas

Tool for Search and Replace across multiple files.
Post Reply
userr
Posts: 6
Joined: Wed Mar 25, 2015 12:52 pm

Some ideas

Post by userr »

Thanks, this program is very useful, I would like to offer some suggestions based on my experiences.

- Ability to list all files without any in-file searching, according to current filters and location would be useful when working on big number of files. This way we could narrow the selection further using the many sorting options.

- Ability to set a file size range could be useful for example to avoid big files or big number of useless files. But the first suggestion above would eliminate this need, even if not as effectively.

- Ability to load a file list from a text file for highly specific searching. The list could be generated using the already implemented feature that allows to copy the path/file names to clipboard. So let's say there are millions of files and we only need to work on some specific files we could generate a list using TextCrawler or some other program and could resume to work on the list on TextCrawler at a later date. The current alternative I use is by listing the file names by semicolons on the file filter with or without wildcards but this may result in unwanted files from different paths or other problems (very long lists?).

- Bug? If I search for regexp ^ it finds zero-byte files but not when I use limit to lines from 1 to 1. I actually tried this hoping it would speed up finding empty files. The empty files are not useful by themselves, but their path names are useful in my case.

- (If this is currently possible) The recent feature of replacing with path/file name is a useful addition but if it was possible to use as many of the file attributes (path, file name, file type, file size, date, year, month, day) as possible as variables in both finding and replacing text, it would be very useful.

Like: $filepath, $filename, $filesize, $filetype etc.

Example
Regex: $filename
Replace: Full Path: $filepath\$filename \r\n Size: $filesize \r\n Year: $cyear \r\n Last Update: $mdate
(c for created, m for modified)
userr
Posts: 6
Joined: Wed Mar 25, 2015 12:52 pm

Re: Some ideas

Post by userr »

Maybe related to my first suggestion, I often needed to insert or replace a unique text for each file. I guess this is a common need.

Example:
1.txt insert apple
2.txt insert orange
3.txt insert banana

I thought there was no efficient way to do this but I guess the batch mode in 3.0 version makes this easier using "set input file" in batch mode for each command. Correct? I have not tried that yet.

I think my first suggestion could be implemented as changing the title "Input from single file" to "Input from file(s)" then there would be the current single file selection and another selection for a list of multiple files.

So in batch mode that could also mean rather than entering commands for each file separately, we could set a text file as file list for each command. So for example, insert apple into "1.txt, 13.txt, 80.txt". insert orange into "2.txt 23.txt". insert banana into "3.txt 4.txt 5.txt". Just by linking to the text file containing a list.
userr
Posts: 6
Joined: Wed Mar 25, 2015 12:52 pm

Re: Some ideas

Post by userr »

Just for the record, I think I have finally found a way to use the file attributes as variables. If my assumptions about the new batch mode is true, then we could:

1- export the match list. which contains all the details about files.
2- take the data we need to search for or replace/insert into files.
3- use reg ex on the list to create an importable batch script

So that regardless of the number of files or commands, we could easily and very efficiently target each file in a unique way using its attributes or anything else we have.
userr
Posts: 6
Joined: Wed Mar 25, 2015 12:52 pm

Re: Some ideas

Post by userr »

Setting the input file before each command doesn't seem to be possible yet. I don't yet fully understand the new batch mode but could you make these things possible?

I have tried a batch with,
0 SetFile
1 FindRep
2 SetFile
3 FindRep
...

But it warns the SetFile at line 2 could only be used before the first Find/Replace operation
userr
Posts: 6
Joined: Wed Mar 25, 2015 12:52 pm

Re: Some ideas

Post by userr »

- For deleting files, an option to directly delete files instead of moving to the recycle bin would be helpful.

- An option to keep the structure when moving/copying files would also be very useful.
User avatar
DigitalVolcano
Site Admin
Posts: 1725
Joined: Thu Jun 09, 2011 10:04 am

Re: Some ideas

Post by DigitalVolcano »

Thanks for all the suggestions - I'm currently planning the updates for version 3.0.5 so will take these into account.

The batch mode command currently only allows you to set one file - the commands are executed at the start of the script before the processing is done.

You could achieve your desired effect by using a command line batch script though:

From the manual:

Code: Select all

Specifying a single input file and output folder, run a batch script in replace mode, closing the program upon completion.
TextCrawler.exe /fn "D:\My Data\convertme.txt" /of "D:\Outputs" /b "D:\BatchFiles\Converter.txc" /r /c
http://www.digitalvolcano.co.uk/textcra ... =&sct=MzA4

so for instance, in myscript.bat:

Code: Select all

TextCrawler.exe /fn "D:\My Data\1.txt" /of "D:\Outputs" /b "D:\BatchFiles\apple.txc" /r /c
TextCrawler.exe /fn "D:\My Data\2.txt" /of "D:\Outputs" /b "D:\BatchFiles\orange.txc" /r /c
TextCrawler.exe /fn "D:\My Data\3.txt" /of "D:\Outputs" /b "D:\BatchFiles\banana.txc" /r /c
userr
Posts: 6
Joined: Wed Mar 25, 2015 12:52 pm

Re: Some ideas

Post by userr »

New suggestions.

- Extract to file option, because I cannot extract data beyond a small limit, it gives a memory exception error

- Extract option/tab for Regular expression tester
Post Reply