Skip to content

MentoringInstructing/textcomparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Application code to compare two text files

Description

This project is my first on programming career and this project was assigned by my mentor. The code is purposefully to be used in an application to compare two text files. The code uses simple programming logic to run, based on my current coding abilites.


Features

  • Insert names of two text files (.txt) to compare between;
  • The code will run through each line of text and not senteces nor words;
  • The different lines between text files will be extracted and shown on the console, included the information which line number is different;


    How to use
  1. Open Python program, copy the code from here and paste it;
  2. Hit "Run" on Python;
  3. Enter text files' names, that you already know that they exist. Both files must be placed on the Python directory: "C:\Users\Username\PycharmProjects\Projectname";
  4. Proceed as per console program requirements;
  5. Check the results.


    Requirements to run the code
  • Python ver 3.0 and up.


    TODO: Improvements in the future
    Add feature:
  • For file exception, when there is not the appropriate file name found;
  • To compare text by words, meaning to find the "only" different words for similar sentences;
  • To compare >2 files at same time;

Running the tests

  1. For testing purpose, download two text files, namely: Textfile1.txt and Textfile2.txt;
  2. Move to the specified location directory as per "How to use";
  3. Open Python and run the code
  4. The results should shown as below:

>+ Line-2 This sentence is only in the file named Testfile1 and should be shown on results, noting that it exists only on this file.

<+ Line-3 This sentence is only in the file named Testfile2 and should be shown on results, noting that it exists only on this file.

> Line-4 This sentence should shown from both files noting only for the difference on word between file Testfile1 and Testfile2.

< Line-4 This sentence should shown from both files noting only for the difference on word between file Testfile2 and Testfile1."

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages