@MinDoc(copyright="Copyright 2009 - 2017, 2021 A. Weinert", author="Albrecht Weinert", version="V.65", lastModified="3.06.2024", usage="start as Java application (-? for help)", purpose="find and replace multiple texts in multiple files") public class FuR extends App
Prop
's syntax for indexed properties (new150 and
new[150] would both be recognised, e.g.).keepFileDate
= true) the
modification date of a modified file will be set to the maximum
of it's own old file date and that of all used replacement files
for which that property is true. (In other words: it's possible
if a newer file is inserted into an older one, to set the
newer include file's date.)TextHelper.fUr(CharSequence, ..)
used, of course, in this application's
FileVisitor
s.java FuR -i .\+.java -r de.weaut de.weAut
java FuR .\+.html "<br>" "<br />" -i -r
java FuR jdk1.3\docs\de\frame4j\+.html api\ api/ -i -v
api\
by api/
so repairing a fault done by quite
many javaDoc.exe versions in Java3 days when doing relative linking.Feuerwehrhauptmann ==> Feu­er­wehr­haupt­mann
– or the other way round.­
hyphenated word per per line made according to the example
hyphTest.txt.-hyphEnc ISO8859-1
, e.g. or
-hyphISO1
to change.FuR
(use option -omitFrntMt).ComVar.Impl
Modifier and Type | Field and Description |
---|---|
boolean |
deHyphen
Hyphenate or de-hyphenate.
|
String |
directory
Start directory.
|
protected String[] |
fileNs
Replacement text / substitute file name; (multiple).
|
String |
filModEnc
Encoding of files to be modified.
|
boolean |
forward
Sequence of (multiple) replacements.
|
String |
hypFilEnc
Encoding of the hyphenation definition file.
|
boolean |
hyphen
Hyphenate or de-hyphenate.
|
String |
hyphFile
Path of the hyphenation definition file.
|
protected boolean[] |
ignCase
Ignore case for search text matching (multiple).
|
String |
ignFilesWith
Exclude text.
|
String |
ignFilesWith2
Exclude text (number 2).
|
boolean |
ignoreCase
Ignore case for search text matching.
|
boolean |
ignoreWS
Ignore white spaces for search text matching.
|
protected boolean[] |
ignWS
Ignore white spaces search text matching (multiple).
|
boolean |
incFileDate
Add (only) 1/2 s the last file in case of replacements.
|
protected boolean[] |
keepBrace
Keep the braces, when replacing text (multiple).
|
boolean |
keepBraces
Keep the braces, when replacing text.
|
boolean |
keepFileDate
Keep the file date even after replacements.
|
protected long[] |
newModif
Modification date for the substitute (multiple).
|
protected String[] |
newT
Replacement text; substitute (multiple).
|
String |
newText
Replacement text; substitute.
|
protected String[] |
oldE
Search text, end (multiple).
|
String |
oldEnd
Search text (end).
|
protected String[] |
oldT
Search text (multiple).
|
String |
oldText
Search text (begin).
|
boolean |
omitFrntMt
Omit front matter.
|
boolean |
recursion
Recursively visit sub-directories.
|
boolean |
sortHyphDefs
Sort hyphenation definitions by descending length.
|
String |
types
File types to regard.
|
boolean |
useNewModif
Use the modification time of the replacement text or substitute.
|
ano, appBase, appIO, appStartTime, appStartTimeMS, args, argsOrig, bgColor, err, fullClassName, help, icon, log, mainThread, myClass, myFrame, name, out, outMode, packName, prop, retCode, runFlag, shortClassName, title, verbose, verbosity
AUTHOR, BLANK_STRING, cons, CONSOL_ENCODING, COPYRIGHT, D, D_NaN, D_NegInf, D_PosInf, EMPTY_INT_A, EMPTY_STRING, FILE_ENCODING, FRW_CLLD, FS, FSS, H, hasCons, HOST_IP, HOST_IPv4, HOST_NAME, INIT_ERROR, JAR_ENCODING, JH, JOB_DONE_OK, JRL, LOG_OUT_ERROR, M, MAIN_THREAD_EXC, NO_BYTES, NO_CLASSES, NO_DOUBLES, NO_OBJECTS, NO_PARS_ERROR, NO_STRINGS, NOT_WINDOWS, ON_PI, ONE_DAY, ONE_HOUR, ONE_LEAP_YEAR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, ONE_YEAR, OS, PROG_NAME, PROG_SHORT, PS, RUNTIME, S, SHY, UD, UL, UL_UR_da, UR
ILLEGAL_TYPE, ILLEGAL_VALUE, NO_ATTRIBUTE, NO_KNOWN_ATTRIBUTE, NO_VALUE, OK, retVtext
Modifier and Type | Method and Description |
---|---|
int |
doIt()
Working method of FuR.
|
static void |
main(String[] args)
Start method of FuR .
|
boolean |
parsePartial()
Partial start parameter parsing by Prop.
|
actionPerformed, allowNoPropertiesFile, clientOrder, condHelpLog, connect, errMeld, errMeld, errorExit, errorExit, errorText, extraPropertiesFile, formMessage, formMessage, formMessage, getAbout, getAboutText, getActTime, getAppLogger, getAppStartTime, getArgs, getAuthor, getCopyright, getDbLogger, getExecTimeMs, getExecTimeMsL, getExecTimeString, getHelp, getHelpText, getIcon, getLanguage, getLogHandler, getMessageComponent, getMessageComponentsLength, getMyFrame, getName, getNameWithVersDate, getOutMode, getProp, getPurpose, getStartTime, getStateString, getTheCloser, getTitle, getUsage, getVerbose, getVerbosity, getVersDate, go, go, go, haveIcon, isDebug, isHelp, isHelpLog, isNormal, isRunFlag, isSilent, isTest, isVerbose, logVerbose, logVerbose, makeStatusTextEnd, makeStatusTextStart, messageFormat, normalExit, performeAction, queueAction, regAsStdMBean, repExc, setAboutText, setAttribute, setAttribute, setAuthor, setBgColor, setCodePages, setCopyright, setHelp, setLogOut2, setName, setOutMode, setOutMode, setPurpose, setTitle, setUsage, setVerbose, setVerbose, setVerbosity, setVerbosity, setVersDate, stop, threeLineEndMsg, toString, twoLineEndMsg, twoLineStartMsg, valueLang, valueLang, wakeMainThread
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
retVtext
public boolean hyphen
hyphen
or deHyphen
is true
FuR gets
its old / new find and replace pattern from the text file
hyphFile
only.public boolean deHyphen
hyphen
or deHyphen
is true
FuR gets
its old / new find and replace pattern from the text file
hyphFile
only.public String hyphFile
­
) word per line text
file:Klas­sen­ver­band
Feuer­wehr­haupt­mann
twelve­year­old
anx­ious
stu­pid
-;
instead of the XML entity ­
, let this
program FuR
replace the first with the latter:java de.frame4j.FuR myHyphFile.txt "-" "­" -v
public boolean sortHyphDefs
true
(default), before their use, the hyphenation definitions
will sorted by descending length of the words not counting the
­
s.public String hypFilEnc
hyphFile
public boolean omitFrntMt
TextHelper.isFrntMttr(CharSequence)
public boolean recursion
public String oldText
oldEnd
public String oldEnd
oldEnd
not null or empty, then oldText
and
oldEnd
form braces to find a spot for replacement. An
exemplary use would be two distinct HTML comments to mark a spot for
inserting or replacing a new text (block).public String newText
public boolean useNewModif
keepFileDate
is true)keepFileDate
is
false.public boolean keepFileDate
incFileDate
public boolean incFileDate
keepFileDate
, but with a tiny increase of the last
file modification date.public boolean ignoreCase
public boolean ignoreWS
protected boolean[] ignCase
ignoreCase
protected boolean[] ignWS
ignoreWS
protected String[] newT
protected String[] fileNs
protected long[] newModif
public boolean keepBraces
protected boolean[] keepBrace
public String ignFilesWith
ignFilesWith
not null or empty, files containing this text
as is will not be touched (even if matching the visitor's file and
directory criteria).FuR
that's the
procedure to inhibit multiple works on the same file.public String ignFilesWith2
public boolean forward
public String directory
public String types
public String filModEnc
public boolean parsePartial()
parsePartial
in class App
App(String[])
public static void main(String[] args)
args
- command line start parameterspublic int doIt()
doIt
in class App
Prop
,
App.go(String[])
,
App.go(String[], String, CharSequence)
,
App.mainThread