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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
**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="fnr" src="https://github.com/user-attachments/assets/d53d6f94-65f7-46b7-8d25-a29f3b6849b5" />

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

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

## Sponsors

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

set "SRC_DIR=%~dp0"
set "BUILD_DIR=%SRC_DIR%FindAndReplace.App\bin\Release"
set "PACKAGE_DIR=%SRC_DIR%release"
set "MSBUILD=C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
set "ILMERGE=C:\Program Files (x86)\Microsoft\ILMerge\ilmerge.exe"

if not exist "%MSBUILD%" (
echo ERROR: MSBuild was not found at "%MSBUILD%".
exit /b 1
)

if not exist "%ILMERGE%" (
echo ERROR: ILMerge was not found at "%ILMERGE%".
exit /b 1
)

echo Building Release executable...
"%MSBUILD%" "%SRC_DIR%FindAndReplace.sln" /t:Build /p:Configuration=Release /p:Platform="Mixed Platforms" /v:minimal
if errorlevel 1 exit /b 1

if not exist "%PACKAGE_DIR%" mkdir "%PACKAGE_DIR%"

echo Creating one-file package...
"%ILMERGE%" /ndebug /targetplatform:4 /out:"%PACKAGE_DIR%\fnr.exe" "%BUILD_DIR%\fnr.exe" "%BUILD_DIR%\FindAndReplace.dll" "%BUILD_DIR%\CommandLine.dll" "%BUILD_DIR%\EncodingTools.dll"
if errorlevel 1 exit /b 1

echo.
echo Done: "%PACKAGE_DIR%\fnr.exe"
endlocal
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
6 changes: 4 additions & 2 deletions src/EncodingTools/StopWatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,12 @@ public static void PrintCollection(int? totalMilliseconds, StringBuilder sb)

line = key + ": " + secs + " secs, " + stopWatch.Milliseconds + " millisecs";

decimal avgDuration = Math.Round((((decimal)stopWatch.Milliseconds) / stopWatch.StopCount), 1);
decimal avgDuration = stopWatch.StopCount == 0
? 0
: Math.Round((((decimal)stopWatch.Milliseconds) / stopWatch.StopCount), 1);
line += ", " + stopWatch.StopCount + " stops, Avg Duration " + avgDuration + " millisecs";

if (totalMilliseconds != null)
if (totalMilliseconds != null && totalMilliseconds.Value > 0)
{
percent = Math.Round((stopWatch.Milliseconds / (decimal)totalMilliseconds.Value) * 100, 1);
line += ", " + percent + "%";
Expand Down
36 changes: 31 additions & 5 deletions src/FindAndReplace.App/AboutBox.Designer.cs

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

5 changes: 5 additions & 0 deletions src/FindAndReplace.App/AboutBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,10 @@ private void uiSupportedBy_LinkClicked(object sender, LinkLabelLinkClickedEventA
{
Process.Start("http://www.zzzprojects.com/");
}

private void linkUpdates_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://github.com/Pr0metheus2/findandreplace");
}
}
}
4 changes: 3 additions & 1 deletion src/FindAndReplace.App/FindAndReplace.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FindAndReplace.App</RootNamespace>
<AssemblyName>fnr</AssemblyName>
<ApplicationIcon>Resources\favicon.ico</ApplicationIcon>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
Expand Down Expand Up @@ -150,6 +151,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\favicon.ico" />
<None Include="Resources\swap_icon.gif" />
</ItemGroup>
<ItemGroup>
Expand All @@ -170,4 +172,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
70 changes: 51 additions & 19 deletions src/FindAndReplace.App/MainForm.Designer.cs

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

Loading