To perform text file operation like Create File, Compare Text file, Replace words etc we have created jar which you can download Attached Zip File: TextUtility
After extracting zip file you will get jar file which contains below functionality which is extremely easy to use.
Functions
appendLine → Read Text File and append new line to existing text file.
compareTextFiles → Compare two text files and also consider or ignore case.
createTextFile → Used to create new text file.
readTextFile → Used to read text file and returns List of lines.
replaceRegrex → It will search text based on regular expression and replace all matching text from file.
searchRegrex → Search String using regular expression/String.