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

Updated Release: 1.7 (May 29, 2014)

$
0
0
Bug fixes
  • Refactored logic for encoding text values to command line to handle common edge cases where find/replace operation works in GUI but not in command line

Updated Wiki: Home

$
0
0

Version 1.7 has been released on May 29th, 2014!

Read all about it here

IMPORTANT: If you use quotes or backslashes in command line find/replace text, please regenerate your commands before using fnr.exe in batch. The logic for encoding quotes and slashes has changed to cover all common cases where users had issues.

Version 1.6 has been released on Mar 24th, 2014
Read all about it here

Version 1.5 has been released on Nov 6th, 2013
Read all about it here




Project Description

An open source tool to find and replace text in multiple files.

Features

  • Single file download - fnr.exe (180kb)
  • Replace text in multiple files using windows application or through command line
  • Find Only to see where matches are found
  • Case-sensitive searching
  • Searching for files in one directory or recursing sub-directories
  • Regular expressions
  • Find and replace multi-line text
  • Generate command line button to create command line text to put in batch file
  • Command line help
  • Unit tests of Find/Replace engine

Screenshots

For screenshots I used a common scenario of replacing a ConnectionString in all ConnectionStrings.config in the solution when rolling from staging to production.

Screenshot 1: Finding all occurrences of connection string.

FnR_Screenshot1_Find.png


Screenshot 2: Replacing all occurrences of connection string.

FnR_Screenshot2_Replace.png

Screenshot 3: Generating command line text to run "Replace" using batch file

FnR_Screenshot3_GenerateCommandLine.png


Screenshot 4: Viewing command line options

FnR_Screenshot4_CommandLineHelp.png


Screenshot 5: Finding occurrences using command line.

FnR_Screenshot5_Find_CommandLine.png


Screenshot 6: Replacing occurrences using command line.

FnR_Screenshot6_Replace_CommandLine.png

Background

A couple of months ago I set out to find a simple find and replace tool that I could use when rolling out my projects. For ex. to change various settings in config files to support dev/qa/prod environment.

I was looking for something that would have the following features:
  1. Simple UI to make sure that find/replace does what I need it to
  2. Command line to run find/replace using batch file.


There are many tools available, but they all have the following major issues:
  • Out of date, no updates support for at least a year
for ex. http://www.divlocsoft.com/
  • Bad documentation if any. Many apps mentions that they have command line support, but to find out how it works takes too much effort.
  • Too many features. I just need to type in a couple of fields and click on Run, not to learn a new language.
for ex.
http://www.powergrep.com/
grep/sed variants in windows
  • No access to code. Many tools have 90% of what I need, but if I need just a bit more (support for multi-line) - there is not much I can do.

So I wrote a simple tool to use in my own projects and wanted to share it with others.


Shameless plug for my company: http://www.entechsolutions.com

Updated Wiki: Home

$
0
0

Version 1.7 has been released on May 29th, 2014!

Read all about it here

IMPORTANT: If you use quotes or backslashes in command line find/replace text, please regenerate your commands before using fnr.exe in batch. The logic for encoding quotes and slashes has changed in 1.7 to cover all common cases where users had issues.

Version 1.6 has been released on Mar 24th, 2014
Read all about it here

Version 1.5 has been released on Nov 6th, 2013
Read all about it here




Project Description

An open source tool to find and replace text in multiple files.

Features

  • Single file download - fnr.exe (180kb)
  • Replace text in multiple files using windows application or through command line
  • Find Only to see where matches are found
  • Case-sensitive searching
  • Searching for files in one directory or recursing sub-directories
  • Regular expressions
  • Find and replace multi-line text
  • Generate command line button to create command line text to put in batch file
  • Command line help
  • Unit tests of Find/Replace engine

Screenshots

For screenshots I used a common scenario of replacing a ConnectionString in all ConnectionStrings.config in the solution when rolling from staging to production.

Screenshot 1: Finding all occurrences of connection string.

FnR_Screenshot1_Find.png


Screenshot 2: Replacing all occurrences of connection string.

FnR_Screenshot2_Replace.png

Screenshot 3: Generating command line text to run "Replace" using batch file

FnR_Screenshot3_GenerateCommandLine.png


Screenshot 4: Viewing command line options

FnR_Screenshot4_CommandLineHelp.png


Screenshot 5: Finding occurrences using command line.

FnR_Screenshot5_Find_CommandLine.png


Screenshot 6: Replacing occurrences using command line.

FnR_Screenshot6_Replace_CommandLine.png

Background

A couple of months ago I set out to find a simple find and replace tool that I could use when rolling out my projects. For ex. to change various settings in config files to support dev/qa/prod environment.

I was looking for something that would have the following features:
  1. Simple UI to make sure that find/replace does what I need it to
  2. Command line to run find/replace using batch file.


There are many tools available, but they all have the following major issues:
  • Out of date, no updates support for at least a year
for ex. http://www.divlocsoft.com/
  • Bad documentation if any. Many apps mentions that they have command line support, but to find out how it works takes too much effort.
  • Too many features. I just need to type in a couple of fields and click on Run, not to learn a new language.
for ex.
http://www.powergrep.com/
grep/sed variants in windows
  • No access to code. Many tools have 90% of what I need, but if I need just a bit more (support for multi-line) - there is not much I can do.

So I wrote a simple tool to use in my own projects and wanted to share it with others.


Shameless plug for my company: http://www.entechsolutions.com

Updated Wiki: Home

$
0
0

Version 1.7 has been released on May 29th, 2014!

Read all about it here

IMPORTANT: If you use quotes or backslashes in command line find/replace text, please regenerate your commands before using fnr.exe in batch. The logic for encoding quotes and slashes has changed in 1.7 to cover all common cases where users had issues.

Version 1.6 has been released on Mar 24th, 2014
Read all about it here

Version 1.5 has been released on Nov 6th, 2013
Read all about it here


Project Description

An open source tool to find and replace text in multiple files.

Features

  • Single file download - fnr.exe (181kb)
  • Replace text in multiple files using windows application or through command line
  • Find Only to see where matches are found
  • Case-sensitive searching
  • Searching for files in one directory or recursing sub-directories
  • Regular expressions
  • Find and replace multi-line text
  • Generate command line button to create command line text to put in batch file
  • Command line help
  • Unit tests of Find/Replace engine

Screenshots

For screenshots I used a common scenario of replacing a ConnectionString in all ConnectionStrings.config in the solution when rolling from staging to production.

Screenshot 1: Finding all occurrences of connection string.

FnR_Screenshot1_Find.png


Screenshot 2: Replacing all occurrences of connection string.

FnR_Screenshot2_Replace.png

Screenshot 3: Generating command line text to run "Replace" using batch file

FnR_Screenshot3_GenerateCommandLine.png


Screenshot 4: Viewing command line options

FnR_Screenshot4_CommandLineHelp.png


Screenshot 5: Finding occurrences using command line.

FnR_Screenshot5_Find_CommandLine.png


Screenshot 6: Replacing occurrences using command line.

FnR_Screenshot6_Replace_CommandLine.png

Background

A couple of months ago I set out to find a simple find and replace tool that I could use when rolling out my projects. For ex. to change various settings in config files to support dev/qa/prod environment.

I was looking for something that would have the following features:
  1. Simple UI to make sure that find/replace does what I need it to
  2. Command line to run find/replace using batch file.


There are many tools available, but they all have the following major issues:
  • Out of date, no updates support for at least a year
for ex. http://www.divlocsoft.com/
  • Bad documentation if any. Many apps mentions that they have command line support, but to find out how it works takes too much effort.
  • Too many features. I just need to type in a couple of fields and click on Run, not to learn a new language.
for ex.
http://www.powergrep.com/
grep/sed variants in windows
  • No access to code. Many tools have 90% of what I need, but if I need just a bit more (support for multi-line) - there is not much I can do.

So I wrote a simple tool to use in my own projects and wanted to share it with others.


Shameless plug for my company: http://www.entechsolutions.com

Updated Release: 1.7 (May 29, 2014)

$
0
0
Bug fixes
  • Refactored logic for encoding text values to command line to handle common edge cases where find/replace operation works in GUI but not in command line

Released: 1.7 (May 29, 2014)

$
0
0
Bug fixes
  • Refactored logic for encoding text values to command line to handle common edge cases where find/replace operation works in GUI but not in command line

Updated Wiki: Home

$
0
0

Version 1.7 has been released on May 29th, 2014!

Read all about it here

IMPORTANT: If you use quotes or backslashes in command line find/replace text, please regenerate your commands before using fnr.exe in batch file. The logic for encoding quotes and slashes has changed in 1.7 to cover all common cases where users had issues.

Version 1.6 has been released on Mar 24th, 2014
Read all about it here

Version 1.5 has been released on Nov 6th, 2013
Read all about it here


Project Description

An open source tool to find and replace text in multiple files.

Features

  • Single file download - fnr.exe (181kb)
  • Replace text in multiple files using windows application or through command line
  • Find Only to see where matches are found
  • Case-sensitive searching
  • Searching for files in one directory or recursing sub-directories
  • Regular expressions
  • Find and replace multi-line text
  • Generate command line button to create command line text to put in batch file
  • Command line help
  • Unit tests of Find/Replace engine

Screenshots

For screenshots I used a common scenario of replacing a ConnectionString in all ConnectionStrings.config in the solution when rolling from staging to production.

Screenshot 1: Finding all occurrences of connection string.

FnR_Screenshot1_Find.png


Screenshot 2: Replacing all occurrences of connection string.

FnR_Screenshot2_Replace.png

Screenshot 3: Generating command line text to run "Replace" using batch file

FnR_Screenshot3_GenerateCommandLine.png


Screenshot 4: Viewing command line options

FnR_Screenshot4_CommandLineHelp.png


Screenshot 5: Finding occurrences using command line.

FnR_Screenshot5_Find_CommandLine.png


Screenshot 6: Replacing occurrences using command line.

FnR_Screenshot6_Replace_CommandLine.png

Background

A couple of months ago I set out to find a simple find and replace tool that I could use when rolling out my projects. For ex. to change various settings in config files to support dev/qa/prod environment.

I was looking for something that would have the following features:
  1. Simple UI to make sure that find/replace does what I need it to
  2. Command line to run find/replace using batch file.


There are many tools available, but they all have the following major issues:
  • Out of date, no updates support for at least a year
for ex. http://www.divlocsoft.com/
  • Bad documentation if any. Many apps mentions that they have command line support, but to find out how it works takes too much effort.
  • Too many features. I just need to type in a couple of fields and click on Run, not to learn a new language.
for ex.
http://www.powergrep.com/
grep/sed variants in windows
  • No access to code. Many tools have 90% of what I need, but if I need just a bit more (support for multi-line) - there is not much I can do.

So I wrote a simple tool to use in my own projects and wanted to share it with others.


Shameless plug for my company: http://www.entechsolutions.com

Commented Issue: Problems with 1.6 and XP [35]

$
0
0
Hi,
Thanks for this great tool which I use a lot. I've still have XP and used 1.5 version so far. Many times I just start the tool right away to search and replace codes in musicxml files. Starting in the find window I just copy from a file several rules including the cr, lf and tabs. Never had a problem.
If using the find code in a .bat file I needed to add \r to each \n to make it function in that file but only in the find code not in the replace code.

In the 1.6 version all my .bat files still function OK but only after "Use escape chars" had been added to each command line. And I still need to add the \r in the find code. However using the 1.6 fnr tool directly I only can search for one line at the time. It will never find anything if multiple lines are added (just copy and paste the lines from xml opened in Notepad++). So for all my experiments I still need to use the 1.5 version, since I need to copy multiple lines in the find field for my experiments. So what goes wrong?



Comments: Hi, Returned from my vacation and discovered that it works. Thank you very much, Rob

Commented Unassigned: Get "Text To Replace" from file in command line mode [40]

$
0
0
Hello, _thank You for the very useful tool._ I have some problems when try to replace large amounts of text with " " and ' ' commas in it. I'll be deeply appreciated, if You add option "Take text to replace from a txt-file". And it would be great, if new option will work with files of 100 kBytes and bigger...
Comments: Thank you very much for attention to my issue. I thought my problem was because of commas, but when I try with short text block - all works correctly. So, problem is, that one can't replace large text fragments in command line mode, because command line can't process too long commands. And possible solution is to add option "Take text to replace from file". Another problem ___was___, that in GUI "Replace" field had a restricted size: for version 1.5 - limited to 32767 symbols but for version 1.7 beta - unlimited (at least more, then 1 Mb), so this second problem resolved - thank you! Sergei K.

Reviewed: 1.7 (Jun 04, 2014)

$
0
0
Rated 5 Stars (out of 5) - This utility does everything that it should. I completely agree with the author's points about the droves of other grep utilities out there that offer clunky command-line interfaces, at best. The vast majority of grep tools for windows do not offer command-line options, and if they do, they are impossible to figure out due to poor documentation. I love the command-line generator that this program offers. Please keep up the good work.

Created Unassigned: cinst fnr [41]

$
0
0
It would be nice if you could install fnr.exe with cinst

Reviewed: 1.7 (Jun 12, 2014)

$
0
0
Rated 5 Stars (out of 5) - Wow. Thank you. You saved me huge effort!!

Commented Unassigned: Problem with Format CR and LF [24]

$
0
0
Hello. Very great tool! But I have a problem with UNIX (MAC(CR) maybe too?) files.

Search multiline with a UNIX file, I get 0 results. Set Format from UNIX (LF) to DOS (CR+LF) its working fine. It is possible to fix this?
Comments: Where is this "Use Meta Chars" option? I don't see it in either 1.6 or 1.7 (1.51 beta doesn't appear to be available for download any longer).

Created Unassigned: fnr.exe has stopped working [42]

$
0
0
Hello

I found the tool fnr ... and sound to be really matching my needs.
When trying to "find only" ... it have the application that crashes

Anybody had that kind of issue ?
I'm on Windows 7 entreprise edition

Thanks

Commented Unassigned: Command-line piping issues [30]

$
0
0
Hi,

Great tool, really like it. Small issue regarding piping and the --silent switch. Piping to nul only seems to work 90% of the time, at random cases in a batch process it will still output the huge status/result text. Adding the --silent switch prevents this, but when this happens the tool still echo's a blank newline to the console.

It is minor I know, but it does mess with batch processing display and/or logfile output.

Thanks!
Comments: Hi, Have this problem even without piping, the command in a batch file like below. "tools\fnr.exe" --cl --silent --dir "\res" --fileMask "VPout.txt" --excludeFileMask "*.dll, *.exe" --useRegEx --find "<Id>{[A-Z,0-9]{8}-[A-Z,0-9]{4}-[A-Z,0-9]{4}-[A-Z,0-9]{4}-[A-Z,0-9]{12}}<" --replace "<Id>{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}<" My process invokes similar batches several time with the file name (in this case "VPout.txt") being different each time. Also I noticed the console to which it echo is the one from which my root process is invoked. Thanks for the great tool though... Vish

Created Unassigned: doesn't appear to work with word doc and dotx [43]

$
0
0
doesn't appear to work with word doc and dotx

New Post: How to Find and Replace only first match?

$
0
0
Hi,
My present command line in a .bat file (using XP) looks like this:
fnr15.exe --cl --dir "%cd%" --fileMask "*.xml" --excludeFileMask ".dll, .exe" --caseSensitive --useRegEx --skipBinaryFileDetection --showEncoding --find "<top-system-distance>[0-9]{1-3}\.[0-9]{1-3}</top-system-distance>" --replace "<top-system-distance>170</top-system-distance>"

In this case all found <top-system-distance>.</top-system-distance> are replaced by <top-system-distance>170</top-system-distance> in all processed files.

However I want only the first founded <top-system-distance>.</top-system-distance> in every file to be replaced. Can this be realized by adding some simple code?

Thanks,
Rob

New Post: Processing binaries (eg Unicode "eml"==>"mht")

$
0
0
Processing binary files.

I need to edit each new version I receive of an .EXE program, to replace "eml" (Unicode) with "mht". Maybe I am missing something, but I haven't been able to do this with fnr 1.7. (The program creates .eml files; I use a setup that doesn't recognise this Microsoft email extension, but can open them with the .mht extension, the structure is the same). [The file I am using is the PopTrayU binary, extracted from the PopTrayU 5.0 beta 12 distribution. I can provide details if relevant, though any binary with embedded Unicode will probably behave the same.]

I'm not sure whether to add this to the the existing topic "Feature request - option to ignore binary file detection". That ended with "v1.4 now allows this", so I think a new topic is called for.

i have been trying to use fnr with the --skipBinaryFileDetection switch to handle executable files, and failing miserably. The program finds matches to my 3-character Unicode string and replaces them if --alwaysUseEncoding is "utf-7" or "utf-8", but completely garbles the file (changes every byte, increases the size by a factor of 2 or 3). In GUI mode the --alwaysUseEncoding switch is ignored, so I can only work in command-line mode.

I have been trying commands such as
"R:\fnr.exe" --cl --dir "R:" --fileMask "PopTrayU.exe" --SkipBinaryFileDetection --alwaysUseEncoding "utf-8" --find "eml" --replace "mht"

I can obviously do this with a hex editor, but fnr would let me make a CMD file once and for all. Can fnr do this, if so how? Some related suggestions:
  1. It would be useful, whatever else is done, to enable fnr in GUI mode to find and report the location of, if not replace, strings in any file, including binaries.
  2. It would be useful to enable --alwaysUseEncoding in GUI mode in general, possibly by including it on the command-line used to invoke the program. It would only make sense to allow replacement if clean replacement is possible (without corrupting the whole file).
  3. it would be useful to allow clean replacement of strings in binary files, perhaps with a check that the replacement string is of the same length (with user notification rather than block). Obviously, only the specified string should be changed (I say this because the present replace massively corrupts the whole file), with a replacement normally of the same length.
Editing binaries may of course cause problems, but is safe enough if tested on a backed-up file. An attempt to edit a binary so should be clearly signposted rather than blanket-banned.

Having said that, fnr is brilliant. I use it to edit VMWare virtual machine .vmx files, interchanging a 4-line block; constructing a command line by hand would have been a pain, fnr's Gen Replace Command Line is brilliant to create batch files. I swap the entire blocks:

[hash]Lose changes this session at shutdown:
scsi0:0.mode = "independent-nonpersistent"
snapshot.action = "autoRevert"
snapshot.disabled = "TRUE"
displayName = "XP (no save)"

[hash]Keep changes:
scsi0:0.mode = "persistent"
snapshot.action = "keep"
snapshot.disabled = "FALSE"
displayName = "XP (SAVES)"

New Post: Specifying path

$
0
0
  1. It would add to fnr's flexibility without losing anything if a single pathname could optionally be specified instead of both path (dir) and name (FileMask) separately. Thus a path specified as C:\Some Directory\AParticularFile.txt or C:\Some Directory*.txt, with dir omitted or blank, would be split internally and used as if C:\Some Directory\ and AParticularFile.txt had been entered separately in GUI or CLI. It would simplify CMD batch files a little. (I often use CMDs to process a single file.)
  2. One issue I had, somewhat related to the above, was running fnr in the current directory. I tend to copy fnr.exe where I need it, and work there. I tried various options that work in many contexts such as ".", ".\DATA" (to use the same directory structure on different drives) without success. I don't remember what else I tried, it took a while. Anyway, the result:
To make fnr work on the current directory, use switch
--dir "%cd%"

Reviewed: 1.7 (Aug 05, 2014)

$
0
0
Rated 5 Stars (out of 5) - Excellent tool! I just love the fact that it can be used in batch files/cmd &/or with the GUI. Stable, powerful... Great job!
Viewing all 144 articles
Browse latest View live


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