For a Dynamics developer, looping through a text file is a very common task. We're sent a file from some source and asked to import it into our company.
Today's task is to import a pipe delimited file into GL. The file looks (in part) like this:
00001|Current portion of Notes Pay. |01312012|123.000 |000-2900-00
00001|Current portion of Notes Pay. |01312012|-123.000 |000-2800-00
00002|Monthly Amortization Charge. |01212012|982.92000 |000-6300-00
00002|Monthly Amortization Charge. |01212012|-982.92000 |000-1610-00
We're going to make use of the TextFieldParser class to do the heavy lifting here. We'll cover a basic TextFieldParser example, and then get into a very nice piece of code that will save you tons of time.
Like all our code; we write these articles in order to save you development time. You'll find this one on the .NET Development menu under General.