This Python script reads a user-specified text file, modifies each line by adding a prefix, and writes the updated content to a new file.
- Asks the user for a filename
- Adds the prefix
[MODIFIED]
to every line - Writes the modified content to a new file named
modified_<original>.txt
- Handles errors like missing files, permission issues, and unexpected exceptions
Input file: example.txt
Hello world
Python is awesome
Output file: modified_example.txt
[MODIFIED] Hello world
[MODIFIED] Python is awesome
FileNotFoundError
— File doesn't existPermissionError
— You don't have permission to access the file- General
Exception
— Any unexpected runtime issues
file_modifier.py
— Main scriptREADME.md
— Project documentationLICENSE
— MIT License
Augusto Mate
📧 mate.augusto.mz@gmail.com
This project is licensed under the MIT License.