Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Z.Lab/
*.userprefs
_ReSharper.*
*.ReSharper.user
*.resharper.user
*.resharper.user
src/log.txt
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
**Note:**
Original [FindAndReplace project](https://github.com/zzzprojects/findandreplace) does not seem to be maintained anymore, so I've decided to forked and fix some bugs. Feel free to use it as you wish.

# What's Find and Replace (FNR)?
Find and Replace (FNR) is an open source tool to find and replace text in multiple files. It can quickly search through large numbers of files and also find the information using regular expressions specifying the form of what you want, instead of literal text.

<img width="886" height="683" alt="image" src="https://github.com/user-attachments/assets/e7a40dc4-c64e-4994-9f7d-51013438bdfe" />


Read more on our [Website](http://findandreplace.io/).

[Download](http://findandreplace.io/download)
[Download](https://github.com/Pr0metheus2/findandreplace/releases)

## Sponsors

Expand Down
48 changes: 48 additions & 0 deletions src/BuildVersionedExe.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@echo off
setlocal enabledelayedexpansion

:: Define paths
set ASSEMBLY_INFO=%~dp0FindAndReplace.App\Properties\AssemblyInfo.cs
set RELEASE_DIR=%~dp0FindAndReplace.App\bin\Debug\
set ILMERGE_PATH="C:\Program Files (x86)\Microsoft\ILMerge\ilmerge.exe"

:: Extract version
for /f "tokens=2 delims=()" %%a in ('findstr /c:"[assembly: AssemblyFileVersion" %ASSEMBLY_INFO%') do (
set VERSION_RAW=%%~a
)

:: Remove dots to get fnrXXX.exe format
set VERSION_CLEAN=%VERSION_RAW:.=%

:: Set output name
set OUTPUT_NAME=fnr%VERSION_CLEAN%.exe

echo Current Directory: %CD%
echo VERSION_RAW: [%VERSION_RAW%]
echo VERSION_CLEAN: [%VERSION_CLEAN%]
echo OUTPUT_NAME: [%OUTPUT_NAME%]
echo RELEASE_DIR: [%RELEASE_DIR%]

echo ILMERGE_PATH: [%ILMERGE_PATH%]
if not exist %ILMERGE_PATH% (
echo ERROR: ILMerge not found at %ILMERGE_PATH%
pause
exit /b 1
)

echo Building %OUTPUT_NAME%...

pushd %RELEASE_DIR%
echo Working Directory (in pushd): %CD%
echo Files present:
dir /b fnr.exe FindAndReplace.dll CommandLine.dll EncodingTools.dll
%ILMERGE_PATH% /log:log.txt /targetplatform:4 /out:%OUTPUT_NAME% fnr.exe FindAndReplace.dll CommandLine.dll EncodingTools.dll
popd

echo Checking if %OUTPUT_NAME% exists in %RELEASE_DIR%...
if exist "%RELEASE_DIR%%OUTPUT_NAME%" (
echo Success: %OUTPUT_NAME% created.
) else (
echo ERROR: %OUTPUT_NAME% not found.
echo Check %RELEASE_DIR%log.txt for details.
)
2 changes: 1 addition & 1 deletion src/EncodingTools/EncodingTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>EncodingTools</RootNamespace>
<AssemblyName>EncodingTools</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
Expand Down
9 changes: 3 additions & 6 deletions src/FindAndReplace.App/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/FindAndReplace.App/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.1")]
[assembly: AssemblyFileVersion("1.8.1")]
[assembly: AssemblyVersion("1.8.3")]
[assembly: AssemblyFileVersion("1.8.3")]
2 changes: 1 addition & 1 deletion src/FindAndReplace/EncodingDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum Options
MLang = 4
}

public static Encoding Detect(byte[] bytes, EncodingDetector.Options opts = Options.KlerkSoftBom | Options.MLang, Encoding defaultEncoding = null)
public static Encoding Detect(byte[] bytes, EncodingDetector.Options opts = Options.KlerkSoftBom | Options.MLang | Options.KlerkSoftHeuristics, Encoding defaultEncoding = null)
{
Encoding encoding = null;

Expand Down
16 changes: 0 additions & 16 deletions src/log.txt

This file was deleted.