The idea for my code arose from my non-profit organization Citizens of Tomorrow in which every time a new student signs up, this welcoming letter with their information would be sent to them. Now, a way to simplify this process would be to have a code that replaces all given words with another given word. With this code, I could put one’s name and order number in the welcoming letter without manually putting this information in.

What it does

It monitors new files in folders to find and replace words and patterns using Regex.

How I built it

I used visual studio code and java extension.

Challenges we ran into

I had to google the regex pattern for credit cards, social security numbers, and phone numbers. In the FileOperate class, the stream could only be used once, so a second stream had to be opened for another operation.

Accomplishments that we're proud of

I created a working function for the string replacement feature that counts the number of words matching the pattern and replaces all the matches with another word.

For the directory monitoring feature, I figured out how to use file watch events.

What we learned

I learned how to use WatchEvent, Stream, FileOperate, and Regex pattern match.

What's next for DirectoryMonitor

DirectoryMonitor will create a config file to do multiple operations, such as matching all different patterns. The application will also watch excel file change and extract new user information to send emails.

Built With

Share this project: