Advertisement

06.13.2007 at 08:07PM PDT, ID: 22632860
[x]
Attachment Details

Read and Write text files (seamlessly) with VB.net

Asked by stephaniem712 in Visual Studio .NET 2005, .Net Editors & IDEs

Tags: file, text, write, read

I am attempting to write a vb.net program that will call another program which exports data from an accounting program into a text file in a specific format (tab delimited).  I can't change the order of the fields at this point nor the format.  I need to then take the text file that is generated and create another text file in the order specified by our client along with some addiitonal fields that are not in the original export. For example the original exported text file would read:
CustID, CustName, CustPhone, CustAddress, CustCity, CustState, and so on.
The new text file for the client needs to be:
CustID, CustName, CustCity,CustState, DateExported, and so on.
As you can see the file would be in a different order - omitting fields and adding fields.  
Is it possible to simply read the existing text file and then write only the data I want (along with the additional required data) into a new text file.  I know how to read a text file and write a text file in VB.net.  But am not clear as to how to accomplish the task described above.  Any assistance is greatly appreciated.Start Free Trial
[+][-]06.13.2007 at 09:18PM PDT, ID: 19280760

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio .NET 2005, .Net Editors & IDEs
Tags: file, text, write, read
Sign Up Now!
Solution Provided By: FernandoSoto
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.13.2007 at 10:04PM PDT, ID: 19280909

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32