VB net append data to csv file
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?
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
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
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
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.