Skip to content

JordyMail/Change-String-Into-Number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Words to Number Converter

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.

Overview

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.

Functions

  • 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.

Real-Life Benefits

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.

How It Works

  1. The program reads a text file where each line contains a number written in words.
  2. It processes each line by converting the words into numerical values.
  3. The results are saved in a new file with "_converted" appended to the original filename.

How to Use

Prerequisites

  • Ensure Python is installed on your system.
  • Save your numbers in words in a .txt file.

Steps to Run

  1. Run the Python script Change-String-Into-Number.py.
  2. Enter the path to the text file when prompted.
  3. The converted numbers will be saved in a new file in the same directory.

Example

Input File (numbers.txt):

one hundred twenty three
four thousand five hundred sixty seven
nine million eight hundred seventy six thousand five hundred forty three

Output File (numbers_converted.txt):

123
4567
9876543

Now, your numbers in words are successfully converted into numerical values! 🚀

About

This project is a Python program that converts numbers written in words into their numerical form.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages