I challange my self to build python system to change string into number, i will open any suggestion or request for you to upgrade this program.
This project is a Python program that converts numbers written in words into their numerical form. It can process a text file containing multiple lines of number words and output a converted file with their corresponding numerical values.
- words_to_number(): Converts a single number in words into numerical format.
- process_text_file(): Reads a text file containing numbers in words, converts each line, and saves the results into a new file.
This tool can be useful in various real-world applications, such as:
- Automating the conversion of financial documents that contain written numbers.
- Helping data entry professionals quickly digitize handwritten amounts.
- Assisting students and researchers in text-to-number conversion tasks.
- The program reads a text file where each line contains a number written in words.
- It processes each line by converting the words into numerical values.
- The results are saved in a new file with "_converted" appended to the original filename.
- Ensure Python is installed on your system.
- Save your numbers in words in a
.txt
file.
- Run the Python script
Change-String-Into-Number.py
. - Enter the path to the text file when prompted.
- The converted numbers will be saved in a new file in the same directory.
one hundred twenty three
four thousand five hundred sixty seven
nine million eight hundred seventy six thousand five hundred forty three
123
4567
9876543
Now, your numbers in words are successfully converted into numerical values! 🚀