Skip to content
+1-888-319-3663

COMMUNITY FORUM

VB net append data to csv file

Dan Bigelow asked 2 years ago
All,
i have to build an output file.  It consists of  a header, detail and trailier. I am using the export to file to create the header and than other maps to create detail and trailer files.  I am then using Bat files to append the detail, and trailer to the header file.  It works when i run it manaully but fails when running on the schedule.  i don’t think the user running the schedule has the rights to use the bat files.  I am thinking i need to use scripts to append the data but I don’t know how in VB.  Any ideas?
Answers
Lorren Zemke Staff answered 2 years ago
Dan,
Here are some examples on adding text to an existing file. 
https://stackoverflow.com/questions/1613666/creating-and-appending-text-to-txt-file-in-vb-net
https://docs.microsoft.com/en-us/dotnet/visual-basic/developing-apps/programming/drives-directories-files/how-to-append-to-text-files
Any of these examples should be able to be used within a Post Map Script task.
 
Lorren
Dan replied 2 years ago

This does look good – Do you think it is the bat files causing the issue. I ran it manually today and it failed the firs time then worked the second… I can’t see any error logs. I guess I can try the scripts and see what happens.


If you would like to submit an answer or comment, please sign in to the eOne portal.