0

I have a requirement to create a console application that will read in data from a file. This data will be used to create new users in a database and assign them roles. The input file will specify usernames to be used and the roles to which these new users will be assigned (7 potential different roles where it is possible to have more than one role).

The users will need to drop a file with the required information into a specified folder and then run the console application.

My question is what would be the best input file type to avoid confusion? E.g. txt, xml, csv, JSON etc. Would it be best to have a single fixed file that the user can edit each time or instead get them to create new files each time? Would it be best to included a README document in the same folder to explain how they should delimit the data correctly?

The people supplying this information will not be developers.

1 Answer 1

2

Entering free form data manually is always a call for mistakes and errors. There are many ways you could avoid some of the problems (the suggestions are listed in order where the best at top):

1-Write a desktop application to generate the file. This should take 1 day at most. The application would generate any kind of file you want and will place it in the correct folder. Alternatively, you can have an MS-Access form prepared in 1 hour or less that inserts the data in a table, that can later be accessed by your console application.

2-Let the user use a spreadsheet and provide them with an appropriate template. Your console application could read the spreadsheet and process it. Even if the user does not have a desktop spreadsheet, there are other web alternatives that are free. The resulting file can be made MS-Excel compatible.

3-Again use the spreadsheet approach with tabs to record each request by date. This way history is maintained. Each tab will have a name of a request date and your application could go for the latest date (the most recent tab) and process the data from there.

4-Ask the user to enter data in a csv format using a text editor (least favorite of course since it could lead to errors). Other file formats are not very easy for end-user to edit correctly.

For options 1,2 and 3, the role value could be designed as a non-enter-able drop down list. A README file is always a good idea.

Your console application, no matter what the input is needs to do extensive validation and report very detailed messages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.