A data processing tool.
dist | 4 years ago | ||
src/main/ java | 4 years ago | ||
.gitignore | 6 years ago | ||
README.md | 7 years ago | ||
build.gradle | 4 years ago | ||
test-data.txt | 7 years ago |
Provides a handy user interface for manipulating text based data.
It is currently fully functional and appears to be quite robust, but was knocked up with features being added on an as-needed quick-and-dirty basis so the code needs a bit of a cleanup.
The binary JAR file is found in the dist
folder of this repository.
It should run on any version of Java from version 7 onwards.
The JAR file in the dist
folder should be executable. If your desktop environment is correctly configured you should be able to double click the JAR file to run it. If not, run the following from the command line:
java -jar jrex.jar
You can use the following to get a dark themed version:
java -jar jrex.jar dark
Capture Expression
text box, and the captured groups will appear in the table.Format Expression
text box and show the TSV output in the output text box.You can use your own capture/format expressions, and click the Capture/Format buttons to apply them.
Open
button to load data from a file.Capture Expression
text box. Refer to the Java API Pattern
documentation for the details on Java's regular expression syntax.Format Expression
text box to define the output format. Refer to captured groups using the Column Prefix
and the column number as shown in the table. e.g. ?1
is the first column.Check the Search/Replace
box to show the pane.
Add search and replace expressions (can be regular expressions including captures and references) into the table. Capture references use the '$
' character as the prefix (see Java API Matcher.replaceAll). Literal '$
' characters will need to be escaped with a backslash ('\
'). Rows can be added and deleted, and moved (replacements are made in the order that they occur in the table) using the appropriate buttons.
The Replace
button will apply the replacements to the data in the input text box and the result will appear in the output text box.
Note that each replacement is applied to the entire input. Regular expressions are executed with the MULTILINE flag enabled by default (^ and $ apply to lines instead of the entire input), but this can be disabled via the (?-m)
flag at the start of the expression.
Output to Input
button.Save
button.Clear
button will clear the input prior to adding new data.Replace blanks?
feature.Listed here, since I can never remember what they are. These can be added to a regular expression to change the match behaviour:
(?i)
- Case insensitive matching.(?s)
- DOTALL mode where the dot character ('.
') matches line breaks.(?m)
- MULTILINE mode where '^
' and '$
' match the start and end of a line instead of the start and end of the entire input.