File Processing I/O

etl2016

Active member
Joined
Jun 29, 2016
Messages
39
Programming Experience
3-5
Hi, apologies for a simple C# question, am not from .Net area.

I am looking for a C# sample program that takes #1. a CSV file as input #2. Changes a couple of columns #3. writes the result into a new file.

Could you please direct me to a sample piece of code or reply here.

many thanks for your help
 
We are not a research forum. You need to do your own research, and write your own code, because we are not a code writing service either. Most of us here are professional programmers and we do this for a career, and we only assist people with code you've either written yourself, or code you're trying to troubleshoot. Our time spent contributing to answering forum questions about code that you have written is done for free. That said, do you not think you are taking advantage of the generosity of the board by asking people to work for you and for free?

I've two acres of land. How about you come round to my home and mow my garden for free?
 
Each of those three steps is a task in itself so you should be handling each separately and researching them independently. You could, if you wanted, write three separate applications that each did one of those steps. That's how independent they are. The main reason that many beginners have trouble finding information is that treat something like this as a single problem, which means that someone else would have to have done the exact same combination of steps and then written about it for them to find information. You need to break the problem down into the smallest parts you can - even smaller than those three steps - and then research each independently and, more importantly, implement each one independently. You then just combine all your partial solutions, massaging at the interfaces as required, and you have a solution to the overall problem. That is exactly how all us professionals work and it's how beginners need to learn to work as soon as possible too.

So, your first step is taking a CSV file as input. Breaking that down, you first need to consider how the application is going to be informed of which file to read. Once you have decided how that will happen, you can then research how to make it happen. As you can see, that's completely independent of even reading the file, never mind modifying the data and writing back to the file. The next step would be actually reading the file. There's no way that you could search for information on reading a CSV file in C# and not find anything, so I can only conclude that you haven't looked. You need to look, put what you find into action and then, if what you try doesn't work, post back with the specifics of the issue you encountered. Etc. Etc.

In short, if you're willing to put in the effort, you'll find us willing and even eager to help you fix your problems. If you just want us to do your homework for you or show you where you can find someone else to do so, you'll be disappointed. We're about helping you become the best developer you can be and that means that you need to be able to write your own code. Trying and failing is an important part of that process.
 
Back
Top Bottom