The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Backup History To CSV File
Posted: 30 Jul 08 5:31 AM
|
Hi,
I've written a script that will take history and back it up to a csv file but I'm having all sorts of issues. I'm trying to follow the conventions of a csv file to the book but it always seems to mess up somewhere all the lines where it comes to the notes or description etc and I'm finding it harder and harder to pin point why. Has anyone done this before and if so can you please shed some light. I just want a csv file that will open in the majority of applications without issues. |
|
|
|
Re: Backup History To CSV File
Posted: 30 Jul 08 6:23 PM
|
Can you elucidate a little on what you mean by 'mess up'?
Is it possible that there are commas in the text fields that are being misinterpreted as delimiters?
If you look at the CSV file in Notepad, you may get a better idea of what is going on.
Phil |
|
|
|
Re: Backup History To CSV File
Posted: 30 Jul 08 6:55 PM
|
I'd do it without any code. Use SQL SSIS or DTS. You can even just use the wizard and then save the package and run on a schedule if needed. Downside would be that it is a server-side solution only, however, you could even easily add something in to e-mail the exported CSV file to someone (or something) |
|
|
|
Re: Backup History To CSV File
Posted: 31 Jul 08 4:44 AM
|
History and CSV is messy because it has lots of control characters embedded into it. If you HAVE to do a text export, you will want to set your own delimiters and then cross your fingers that nobody typed that anywhere. You might want to try using the pipe (or double) |, || since people tend NOT to use them in normal typing. You just have to tell the importing application what you are using as a separator.
|
|
|
|