This project has moved and is read-only. For the latest updates, please go here.

difference between UI and command line

Oct 24, 2013 at 8:47 AM
Edited Oct 24, 2013 at 8:48 AM
Hi,

This simple replace works well in UI (find matches):
replace \r\n with <empty>

but the generated command line does not work (does not find any match):

"fnr.exe" --cl --dir "C:\test\" --fileMask "test.txt" --useRegEx --find "\r\n" --replace ""

the log shows that the file is found.
Stats

Files:
  • Total: 1
  • Binary: 0 (skipped)
  • With Matches: 0
  • Without Matches: 1
  • Failed to Open: 0
  • Failed to Write: 0
Matches:
  • Found: 0
  • Replaced: 0
Duration: 0,078 secs

Any suggestion?

Thanks!
Oct 24, 2013 at 10:10 AM
Hi,

Can you please make sure you are using latest version from:
https://findandreplace.codeplex.com/releases/view/108943

Or try latest beta:
https://findandreplace.codeplex.com/releases/view/113464


I couldn't reproduce the issue with either version.

I created text file:
.................................
Line1\r\n
Line2\r\n
...............................


Ran command:
"fnr.exe" --cl --dir "D:\Temp\FindAndReplaceTest\Support\Discussion1111437\Files" --fileMask "SomeFile.txt" --useRegEx --find "\r\n" --replace ""

and it replaced both instances.

If it is still not working for you. Please send your "test.txt" file to:
eric at entechsolutions dot com.

Eric
Mar 28, 2014 at 10:01 PM
This is a great utility but I get the same types of results. I have tried it with 1.5 and 1.6.
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\TEST>"C:\TEST\fnr.exe" --cl --dir "C:" --fileMask "*.txt" --excludeFileMask "
.dll, .exe" --find ".log:" --replace ".log: "

C:\TEST>

Stats

Files:
  • Total: 0
  • Binary: 0 (skipped)
  • With Matches: 0
  • Without Matches: 0
  • Failed to Open: 0
  • Failed to Write: 0
Matches:
  • Found: 0
  • Replaced: 0

Duration: 0 secs

The Gui shows

Stats

Files:
  • Total: 9
  • Processed: 9
  • Binary: 0 (skipped)
  • With Matches: 1
  • Without Matches: 8
  • Failed to Open: 0
Matches:
  • Found: 5434
Mar 30, 2014 at 6:36 PM
Dev41 wrote:
Hi,

This simple replace works well in UI (find matches):
replace \r\n with <empty>

but the generated command line does not work (does not find any match):

"fnr.exe" --cl --dir "C:\test\" --fileMask "test.txt" --useRegEx --find "\r\n" --replace ""

the log shows that the file is found.
Stats

Files:
  • Total: 1
  • Binary: 0 (skipped)
  • With Matches: 0
  • Without Matches: 1
  • Failed to Open: 0
  • Failed to Write: 0
Matches:
  • Found: 0
  • Replaced: 0
Duration: 0,078 secs

Any suggestion?

Thanks!
Problem is probably the trailing slash in the --dir "C:\test\" field. Try changing it to --dir "C:\test"

The command line parser is a real pain... Also has problems with root directories and file names that contain a "-", ';', etc...
Good Luck!.
Apr 2, 2014 at 6:05 PM
Hi,

Dark_Horse is totally correct about "C:\test\". Last slash is used to escape quote so that dir parameter becomes "C:\test\" --fileMask ".

If you use GUI with "C:\test\" in Dir text box and click "Gen Replace Command List", we automatically remove last "\" from Dir. So this issue can occur only if you create command line manually.

As to second case:
C:\TEST>"C:\TEST\fnr.exe" --cl --dir "C:" --fileMask "*.txt" --excludeFileMask ".dll, .exe" --find ".log:" --replace ".log: "

I tried it locally and couldn't reproduce the issue. Can you please try again with latest stable.
If you still have issues, please send me a couple of files which you are trying to replace to "eric at entechsolutions dot com"

Eric