I have one batch file (.bat) which contains text like:
osql -S %ServerName% -d %DBName% -U %sql_login% -P %sql_passwd% -n -i sp_RejectAccounts_qsel.sql -o sp_RejectAccounts_qsel.out
osql -S %ServerName% -d %DBName% -U %sql_login% -P %sql_passwd% -n -i sp_RejectAccounts_sel.sql -o sp_RejectAccounts_sel.out
osql -S %ServerName% -d %DBName% -U %sql_login% -P %sql_passwd% -n -i sp_GetCompanyRecordCardRequest_01Aug2012.sql -o sp_GetCompanyRecordCardRequest_01Aug2012.out
osql -S %ServerName% -d %DBName% -U %sql_login% -P %sql_passwd% -n -i SPGetCreditTransactions.sql -o SPGetCreditTransactions.out
I need a way to get all the .sql files in, say an array of string.
There has been some changes to the text. The regex should find .sql and then move towards the left till it finds a space.
You can do like this. (i’m using List as container for the input).
I don’t know if it works, perhaps needs abit of adjustments with the index + and -. Depending on the whitespaces.
There is also a possibility to use split to get the filenames. Something like this.