BCP Output parsing (Internationalization)

Oct 4, 2010 at 1:48 PM


it would be a great benefit if you could manage bcp output regexs in different languages. The lines below are for the german version of bcp.exe

Why not determine the current locale and then automatically choose the set of bcp regexs or just let the user pick one of the available sets.


        <add key="BCPRowsCopied" lang="de" value="[0-9]+\sZeilen kopiert" />                    <!-- Regex Search -->
        <add key="BCPError" value="Error =" />                                        <!-- Regex Search -->
        <add key="BCPSQLState" value="SQLState =" />                                  <!-- Regex Search -->
        <add key="BCPTotalSent" value="Insgesamt gesendet: [0-9]+\W+SQLState =" />    <!-- Regex Search -->
        <add key="BCPNumber" value="[0-9]+" />                                        <!-- Regex Search -->
        <add key="BCPSummary" value="Zeit[\w\W]+sec.\)" />                            <!-- Regex Search -->
        <add key="BCPOutputSummary" value="Copied {0} of {1} ({2}%)" />               <!-- Summary output -->
        <add key="BCPCodePage" value="437" />

Oct 4, 2010 at 11:12 PM

Great idea.  I never put it in, but with feedback like yours, I can add in more languages as people provide me with their language specific BCP output.  I will put this on my todo list.


Oct 5, 2010 at 9:10 PM

Hi Frank,

I added sections to the config file too allow for different languages.  I put yours in.  So, in the code, I get the current Thread.CurrentThread.CurrentCulture.Name and use that for the section name in the config file. Can you please check this on your system and see if it works for you? Let me know what you think and if you have any issues. Thanks very much for the data in German.

Anybody else reading this if your language is not included, just reply to this post with your language specific information and I will add it to the master config file.

Thanks very much,

Oct 6, 2010 at 6:45 AM

Great job! Works like a charm!

Regards, Frank