A Console app designed to parse a file, query the file data, and return records.
A .NET Console application designed to parse a CSV file and return records from different queries based on a pre-established set of criteria. The console window will display a list of options in a menu format. The options can be navigated using the Arrow Up 🔼 or Arrow Down 🔽 keys. To select a query, navigate to the menu option and hit Enter
.
The application consists of the following main components:
- CSV Parser
- Data Query
- View
Query | ReturnType | Description |
---|---|---|
Get people with 'Esq' in Company Name |
List<Person> |
Returns a list of people who have the string 'Esq' in their company name |
Query | ReturnType | Description |
---|---|---|
Get people from Derbyshire |
List<Person> |
Returns a list of people who live in county Derbyshire |
Query | ReturnType | Description |
---|---|---|
Get people whose house number is exactly 3 digits |
List<Person> |
Returns a list of people whose house number is exactly 3 digits |
Action | ReturnType | Description |
---|---|---|
Get people whose website URL length is greater than 35 characters |
List<Person> |
Returns a list of people whose URL length > 35 |
Action | ReturnType | Description |
---|---|---|
Get people who live in a postcode with a single digit value |
List<Person> |
Returns list of people whose postcode contains one digit |
- C# / .NET 6
- NuGet
Fork this repo to your Github and then clone the forked version of this repo.
- Setup:
- Open up project in Visual Studio
- This application requires a path pointing to a csv file. By default the path is set using the 'Visual Studio Default Working Directory' and returning its great grand-parent directory. This now defaults to: .\CsvParserConsoleApp\Data
- If your 'Default Working Directory' is not set to application root '\bin\Debug\net6.0', then you will need to specify a new file path:
- To change the filepath in the appliation, you will need to modify the path in the following file:
- Open up a terminal and navigate to the root folder of the main application directory CsvParserConsoleApp:
- run:
dotnet restore
- You can run the unit tests in Visual Studio, or you can go to your terminal and inside the root of this directory CsvParserConsole:
- run:
dotnet test
- The Main Entry Point for the application is: Program.cs