NameSorter is a .NET application designed to sort names from a text file based on their last names and given names. It outputs sorted names both to the console and to a new file, making it suitable for both interactive use and integration into larger workflows.
- Reads names from a text file, where each name is expected to be in the format
GivenNames LastName
. - Sorts names by last name and then by given names.
- Outputs sorted names to the console.
- Saves sorted names to a new text file.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- .NET 6.0 SDK or later
- Clone the repository:
git clone https://github.com/yourusername/NameSorter.git
- Navigate to the project directory
cd NameSorter
- Build the project:
dotnet build
- Run the application using the following command:
dotnet run --project NameSorter [path-to-input-file]
- Example:
dotnet run --project NameSorter ./unsorted-names-list.txt
The sorted names will be displayed in the console and saved to sorted-names-list.txt in the same directory as the input file.
To run automated tests for this system:
dotnet test