I need to write a stored procedure that will read each line of an unformatted text file and record it as a record. (Simple enoug开发者_JAVA技巧h, but haven't run into an example script yet. Or my Google skills are a bit wanting.)
Here's the kicker.
It needs to read up to a certain line of text, then call another stored procedure to loop through the remaining lines to write to another table.
If it were me, I'd pre-process the file into its constituent parts. Splitting a file where the top part is one kind of content and the bottom another is a simple task in something like perl, vbscript, maybe powershell. Once you have the file split, pick your favorite way to read the contents of each file and process the contents accordingly.
精彩评论