Fredashay's Utility Find Replace
2023-11-11This plugin does a global find/replace of newline characters in text files.
This plugin does a global find/replace of newline characters in text files.
Ever had a text file that you wanted to do a global find/replace to insert newlines, or replace tabs with spaces, but the file was too huge to do all the changes by hand? Well, I got your back!
After exhaustive searching, there's no word processor or text editor in existence that can perform find/replace on meta characters like newline or tab (not unless you want to spend hundreds of buckazoids for MS Word or torture yourself with VI).
So that's where this plugin comes in!
Issue /REPLACE [OLDFILE] [FROMCHAR] [TOCHAR] [NEWFILE]
For example /REPLACE FOO.TXT Joe Jane BAR.TXT
All 4 parameters are required.
When typing in the FROMCHAR or TOCHAR, you can specify meta characters or hex characters.
A meta character is one of these:
\b = backspace
\f = form feed
\n = new line
\r = carriage return
\t = tab
\' = single apostrophe
\" = double quote
\\ = backslash character
A hex character is a % followed by two hex digits, for example:
%0D = carriage return
%0A = line feed
%20 = space
%25 = %
%2F = /
%41 = Upper case A
It is not necessary to enclose your change strings in " or '. If you do, they will be treated as part of the string to be changed from/to.
Here are a few examples:
/REPLACE FOO.TXT Bob Jill BAR.TXT
Will change all occurrences of "Bob" to "Jill". but any text editor can do this, meh.
/REPLACE FOO.TXT \t XXX BAR.TXT
Will change each and every occurrence of a tab character to "XXX".
/REPLACE FOO.TXT \t %20%20%20%20 BAR.TXT
Will change each and every occurrence of a tab character to four spaces.
/REPLACE FOO.TXT } }\n BAR.TXT
Will change all occurrences of "}" to "}" followed by a newline, basically inserting newlines after every "}".
/REPLACE FOO.TXT "" "%20" BAR.TXT
Will insert a space between every pair of adjacent quotation marks.
/REPLACE FOO.TXT ' " BAR.TXT
Will change each and every occurrence of a single apostrophe to a double quote.
To install this plugin, copy the plugin JAR file to your server's plugins folder.
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta