Quantcast
Channel: fnr.exe - Find And Replace Tool
Viewing all 144 articles
Browse latest View live

New Post: Replace And Save As New File

$
0
0
Hello...
First of all, thanks for the handy tool.
What I want to do is have an option to save the updated file as a new file.

For instance...
I have a template text file.
I'm running a batch file that does a find/replace of some text, but I don't want that template to be changed.
I want the updated file to be in a totally different spot
I don't think I have the luxury of copying the file, to the new spot, and then doing the replace (an action automatically occurs when the file lands in the new spot).
I guess I could copy to a temp spot, update, copy to the real spot, delete the temp spot.
That seems like too much work, though.

I tried just adding > newfile.txt, to the end of the line, but it updated the original and created an empty new file.
JJ

New Post: Option To LIst Files That Didn't Have Matches

$
0
0
Hello...
I though it was really nice to have an output window that shows the results of the matches.
I would like to be able to see which files DIDN'T have matches, though.
I did a replace on 108 files and 103 of them matched.
I only know of 3 files that SHOULDN'T match.
So, there are 2 files that I'm unsure of.
I would have to, manually, open over 100 files to see which ones didn't get the update.
JJ

Reviewed: 1.7 (Sep 05, 2014)

$
0
0
Rated 5 Stars (out of 5) - Simple and elegant. It blew me away with it's power and ease of use.

New Post: Find and Replace With Uppercase

$
0
0
Is there a way to find specific text and replace it with uppercase version of the same text?

Created Unassigned: batch mode several lines are not wroking [44]

$
0
0
Hi,

nice tool, but when I use it as batch mode in a cmd line I need to put wait state between several replaced lines

f.e. this is not working .. only the first line i replaced:

*****************
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "PosX=[0-9]+" "PosX=1678"
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "PosY=[0-9]+" "PosY=0"
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "SizeX=[0-9]+" "SizeX=898"
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "SizeY=[0-9]+" "SizeY=1049"
goto :eof

:replace_ini
:: %1 is the path
:: %2 is the file
:: %3 is the input string
:: %4 is the string to put
"M:\scripts\fnr.exe" --cl --dir %1 --fileMask %2 --useRegEx --find %3 --replace %4 --silent
goto:eof
*********************
if the called process is the one here than its working:
:replace_ini
:: %1 is the path
:: %2 is the file
:: %3 is the input string
:: %4 is the string to put
"M:\scripts\fnr.exe" --cl --dir %1 --fileMask %2 --useRegEx --find %3 --replace %4 --silent
ping -n 8 localhost >nul
goto:eof

Only difference is that I add a short wait after executing the command
I guess the file close process need some time. Can you do something in upcoming version to have the end of the exe clean with the file closed !

Thx a lot for the nice tool !

New Post: replace -------

$
0
0
Hi, I'm trying to replace "------- " with "index" . the GUI works, but the command line it returns an error: find required options ismissing. I do not understand . Can you help me?

Created Unassigned: Please include line number [45]

$
0
0
Please include the line number whiles displaying the searched "text" and up and down lines. So that it is easy to find which line(s) does the searched text occurs in the file.

Edited Unassigned: Please include line number [45]

$
0
0
Please include the line number while displaying the line(s) with searched "text" and up and down lines. So that it is easy to find which line(s) does the searched text occurs in the file.

Commented Unassigned: batch mode several lines are not wroking [44]

$
0
0
Hi,

nice tool, but when I use it as batch mode in a cmd line I need to put wait state between several replaced lines

f.e. this is not working .. only the first line i replaced:

*****************
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "PosX=[0-9]+" "PosX=1678"
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "PosY=[0-9]+" "PosY=0"
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "SizeX=[0-9]+" "SizeX=898"
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "SizeY=[0-9]+" "SizeY=1049"
goto :eof

:replace_ini
:: %1 is the path
:: %2 is the file
:: %3 is the input string
:: %4 is the string to put
"M:\scripts\fnr.exe" --cl --dir %1 --fileMask %2 --useRegEx --find %3 --replace %4 --silent
goto:eof
*********************
if the called process is the one here than its working:
:replace_ini
:: %1 is the path
:: %2 is the file
:: %3 is the input string
:: %4 is the string to put
"M:\scripts\fnr.exe" --cl --dir %1 --fileMask %2 --useRegEx --find %3 --replace %4 --silent
ping -n 8 localhost >nul
goto:eof

Only difference is that I add a short wait after executing the command
I guess the file close process need some time. Can you do something in upcoming version to have the end of the exe clean with the file closed !

Thx a lot for the nice tool !

Comments: Good tool thank you. I have noticed something similar to this. When using fnr in a batch file there will occasionally be errors I obtain the error "_Error: The requested operation cannot be performed on a file with a user-mapped section open._" The Stats report: _Files: - Total: 1 - Binary: 0 (skipped) - With Matches: 0 - Without Matches: 0 - Failed to Open: 0 - Failed to Write: 1_ _Errorlevel = 2_ My command lines are something like: ``` fnr --cl --find "\t+" --replace " " --filemask kac_events.html --dir C:\Software.ins\SearchReplace\FNR-exe --setErrorLevelIfAnyFileErrors --useEscapeChars --showEncoding --alwaysUseEncoding utf-8 --useRegEx ``` My batch file has 19 calls to fnr.exe There is no predictability as to call to fnr.exe will have this error. Sometimes it happens once and less frequently for 2, 3, 4 times etc. Most of the time there is no error. I have tried dwzenon's approach of inserting a delay between each call using ```ping -n 8 localhost >nul ``` and also the Windows delay ```timeout 5``` The problem did not happen when I had the delay inserted, but due to the random and infrequent occurrence without the delay I would be hesitant to believe that the delay has cured the issue. I have disabled the antivirus. I am using Windows 7 64 bit. Experience suggest to me that this issue is related to Windows disk caching. Many thanks for providing this tool.

New Post: How to strip off BOM

$
0
0
Great tool thank you.

My command lines are something like:
fnr --cl --find "[\r\n\t\f ]*,[\r\n\t\f ]*" --replace "," --filemask kac_events.html --dir C:\Software.ins\SearchReplace\FNR-exe --setErrorLevelIfAnyFileErrors --useEscapeChars --showEncoding --alwaysUseEncoding utf-8 --useRegEx
My input file is encoded utf-8 without BOM

After processing with fnr.exe and I upload the files to the internet and test with the validator http://validator.w3.org/ I obtain the message "Byte-Order Mark found in UTF-8 File. The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported."

If I open the file in notepad.exe in ANSI mode I can see  at the top of the file.

[I can use a BOM stripper utility to strip the BOM but that will not run unattended]
(http://www.mannaz.at/codebase/utf-byte-order-mark-bom-remover/)

Please advise if there is some method to output UTF-8 files without BOM

Many thanks for this tool.

Commented Unassigned: batch mode several lines are not wroking [44]

$
0
0
Hi,

nice tool, but when I use it as batch mode in a cmd line I need to put wait state between several replaced lines

f.e. this is not working .. only the first line i replaced:

*****************
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "PosX=[0-9]+" "PosX=1678"
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "PosY=[0-9]+" "PosY=0"
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "SizeX=[0-9]+" "SizeX=898"
call:replace_ini "C:\Program Files (x86)\myfolder" "file.ini" "SizeY=[0-9]+" "SizeY=1049"
goto :eof

:replace_ini
:: %1 is the path
:: %2 is the file
:: %3 is the input string
:: %4 is the string to put
"M:\scripts\fnr.exe" --cl --dir %1 --fileMask %2 --useRegEx --find %3 --replace %4 --silent
goto:eof
*********************
if the called process is the one here than its working:
:replace_ini
:: %1 is the path
:: %2 is the file
:: %3 is the input string
:: %4 is the string to put
"M:\scripts\fnr.exe" --cl --dir %1 --fileMask %2 --useRegEx --find %3 --replace %4 --silent
ping -n 8 localhost >nul
goto:eof

Only difference is that I add a short wait after executing the command
I guess the file close process need some time. Can you do something in upcoming version to have the end of the exe clean with the file closed !

Thx a lot for the nice tool !

Comments: I have provided some test files to demonstrate this issue and to show that by inserting a delay between successive calls to fnr.exe that the errors go away, longer delays are more beneficial to removing the errors . Extract the zip to C:\Software.ins\SearchReplace\FNR-exe\ Run StressTest-FNR.bat The results report will be in results.txt. The batch file StressTest-FNR calls StressTestSearchReplace0.bat, StressTestSearchReplace1.bat and StressTestSearchReplace2.bat in a 20 times loop. These batch files each call fnr.exe 17 times and process a html file. The bat files have a zero delay, 1 second and 2 second delay between call to fnr.exe according to their names StressTestSearchReplace0, StressTestSearchReplace1 and StressTestSearchReplace2. The results.txt file lists the times when fnr.exe returned an errorlevel of 2. A sample report looks like: ---------- REPORT0.TXT erlvl 2 delete any white space around a right curly bracket erlvl 2 delete any white space around a right curly bracket erlvl 2 delete any white space around a right curly bracket erlvl 2 reinstate :// in URLs erlvl 2 delete any white space around a right curly bracket erlvl 2 delete any white space around a right curly bracket erlvl 2 reinstate :// in URLs erlvl 2 delete any white space around a right round bracket ---------- REPORT1.TXT erlvl 2 reinstate our doc type erlvl 2 delete any white space around a right curly bracket erlvl 2 delete any white space around a semi colon erlvl 2 escape out :// in URLs ---------- REPORT2.TXT According to this the calls to fnr.exe without a delay had 8 errors The calls to fnr.exe separated with a delay of 1 second had 4 errors and the calls to fnr.exe separated with a delay of 2 seconds had zero errors. The section REPORT0.TXT refers to the errors obtained when using StressTestSearchReplace0.bat Warning, these tests take approx 20 mins to run, each time the report files REPORT0.TXT, REPORT1.TXT, REPORT2.TXT and results.txt are deleted. So if you want to keep previous reports then copy them to somewhere else.

Created Unassigned: OutOfMemory Exception [46]

$
0
0
When going through numerous large files, (either find or replace) the application crashes with an out of memory exception. Due to the way the .NET runtime garbage collector works with strings, I don't know if you could easily get around this problem. A x64 bit version would be a stopgap solution. As is, it is unusable for me.

Other than that, it looks like a great program!

Commented Unassigned: OutOfMemory Exception [46]

$
0
0
When going through numerous large files, (either find or replace) the application crashes with an out of memory exception. Due to the way the .NET runtime garbage collector works with strings, I don't know if you could easily get around this problem. A x64 bit version would be a stopgap solution. As is, it is unusable for me.

Other than that, it looks like a great program!
Comments: I just roll my own / dumbed down version and sure enough, since we cannot compact the Large Object Heap, I couldn't just read entire files into memory and to a quick .indexOf or .Replace - I ended up having to have a StreamReader and StreamWriter and handle the files line by line to prevent objects being stored in the LOH. It works just fine this way (and still fast!)

Edited Unassigned: OutOfMemory Exception [46]

$
0
0
When going through numerous large files, (either find or replace) the application crashes with an out of memory exception. Due to the way the .NET runtime garbage collector works with strings, I don't know if you could easily get around this problem. A x64 bit version would be a stopgap solution. As is, it is unusable for me.

Note This this is occurring opening up numerous 3MB files at a time with 25GB of available memory. It's the large number of files (100+) of decent size (1MB+) I am searching through that is causing the issue.

Other than that, it looks like a great program!

Reviewed: 1.7 (Okt 31, 2014)

$
0
0
Rated 5 Stars (out of 5) - Great. Saved me a lot of time.

Reviewed: 1.7 (Nov 01, 2014)

$
0
0
Rated 5 Stars (out of 5) - This one little tool just saved me about an hour's worth of copying and pasting drudgery. It worked well and was extremely fast and efficient.

New Post: DOS window still pops up even with --silent flag

$
0
0
Hello,

The fnr.exe application is exactly what I need for one the pieces for a module that I am building.

The only issue that I have is that even with the --silent flag, a DOS\processing window still flashes to the user while calling the fnr.exe application.

Is there a way to make the execution of this application truly silent?

Regards
Roberto

Reviewed: 1.7 (Nov 04, 2014)

$
0
0
Rated 5 Stars (out of 5) - The best find and replace tool

Created Unassigned: clear regedit config [47]

$
0
0
After some race conditions I cannot repeat, something in register get messed and fnr stops to get results (it scans, show files scanned, but no results)

After notice that fnr remember the last config I started to search where it was recorded. Finally I found it on register

After clean all data there fnr comes back to life

Sadly I haven't recorded regedit config to investigate its data

It would be handy to add a menu action to clear configuration

Created Unassigned: fnr --cl does not recognize it is on a console [48]

$
0
0
Using fnr --cl from a tabbed console wrapper like [conemu](http://code.google.com/p/conemu-maximus5/) confuses fnr an it start another window with a cmd.exe

What is the process fnr uses to detect its presence on a console?
Viewing all 144 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>