I have some text files and I want to import those text files one by one to my database and then apply some updates and extract the files again one by one in .csv format. I want to achieve this using for each loop.. How do I do this?
Please help!!
I have some text files and I want to import those text files one by one to my database and then apply some updates and extract the files again one by one in .csv format. I want to achieve this using for each loop.. How do I do this?
Please help!!
This task requires the use of the File System component in SQL. This component has an "Operation" setting in the menu that allows it to fill several rows, including copying/moving/deleting files, creating directories and more.
Let's break this down to several tasks:
1. Loop through the text files (that I assume are located in one folder and have the same structure). Take a look at this Stackoverflow answer
2. Create a new CSV destination file for each source file and output to them. This is the same idea as step one, just setup a template CSV file in a "neutral" location and copy it each time (don't use the original).
Try this out, let us know what you did and where you get stuck and we can help you out some more.
Good luck!