Здравствуйте уважаемые форумчане!
Очень хотелось бы облегчить себе жизнь при чтении лога.
Если тяжело написать, то дайте наводку, буду рад любой помощи!
Версия AutoIt: 3.
3.3.8.1
Описание:
Редактирование txt файла (лога).
Структура файла такая:
...
1: The SQL script ' ttt.sql' is scheduled to execute. Note that the final decision will be made later if you have a schema version specified for this script. Script Execution=RunOnInstall, Action=Install, Component State=Install, Schema=0001.00008.0000
1: The SQL script 'rollback.sql' is not scheduled to execute. Script Execution=RunOnRollback, Action=Install, Component State=Install, Schema=
1: Attempting to establish the SQL connection... Server: test Database:
1: Attempting to execute SQL scripts...
1: Determining if the SQL script 'struct.sql' will be executed...
1: The SQL script will be executed because no schema version is specified for this script.
1: Prepare executing SQL script file: 'test.sql'. Path: 'C:\Users\KONZUL~1\AppData\Local\Temp\~B898.tmp'
1: Executing SQL at Line 10 >>>
1: Executing SQL at Line 19 >>>
1: Executing SQL at Line 22 >>>
1:ADO Error: Number: -2147467259 Description: ORA-01430:
Source: Microsoft OLE DB Provider for Oracle SQL State: Native Error: 1430
1: There was a SQL scripting error at line 22. Continuing to the next batch.
1: Executing SQL at Line 25 >>>
1: ADO Error: Number: -2147467259 Description: ORA-01430:
Source: Microsoft OLE DB Provider for Oracle SQL State: Native Error: 1430
1: There was a SQL scripting error at line 25. Continuing to the next batch.
1: Executing SQL at Line 28 >>>
1: Executing SQL at Line 31 >>>
1: Executing SQL at Line 41 >>>
1: Executing SQL at Line 45 >>>
1: Executing SQL at Line 55 >>>
1: Executing SQL at Line 56 >>>
1: Finish executing SQL script file: 'test.sql'
1: Determining if the SQL script 'test2.sql' will be executed...
1: The SQL script will be executed because no schema version is specified for this script.
1: Prepare executing SQL script file: 'test3.sql'. Path: 'C:\Users\KONZUL~1\AppData\Local\Temp\~B8B9.tmp'
1: Executing SQL at Line 8 >>>
1: Executing SQL at Line 17 >>>
...
Скрипт должен сохранить в новый файл блоки лога, которые содержат слово Error (можно ADO Error: Number, блок будет начинаться со слова Prepare executing SQL script file, а заканчиваться словом Finish executing SQL script file. В итоге должно получиться что-то подобное:
...
---------------------------------------------
1: Prepare executing SQL script file: 'test.sql'. Path: 'C:\Users\KONZUL~1\AppData\Local\Temp\~B898.tmp'
1: Executing SQL at Line 10 >>>
1: Executing SQL at Line 19 >>>
1: Executing SQL at Line 22 >>>
1: ADO Error: Number: -2147467259 Description: ORA-01430:
Source: Microsoft OLE DB Provider for Oracle SQL State: Native Error: 1430
1: There was a SQL scripting error at line 22. Continuing to the next batch.
1: Executing SQL at Line 25 >>>
1: ADO Error: Number: -2147467259 Description: ORA-01430:
Source: Microsoft OLE DB Provider for Oracle SQL State: Native Error: 1430
1: There was a SQL scripting error at line 25. Continuing to the next batch.
1: Executing SQL at Line 28 >>>
1: Executing SQL at Line 31 >>>
1: Executing SQL at Line 41 >>>
1: Executing SQL at Line 45 >>>
1: Executing SQL at Line 55 >>>
1: Executing SQL at Line 56 >>>
1: Finish executing SQL script file: 'test.sql'
---------------------------------------------
...
Примечания:
В логе несколько таких блоков с ошибками. Сам лог достаточно большой.
Очень хотелось бы облегчить себе жизнь при чтении лога.
Если тяжело написать, то дайте наводку, буду рад любой помощи!
Версия AutoIt: 3.
3.3.8.1
Описание:
Редактирование txt файла (лога).
Структура файла такая:
...
1: The SQL script ' ttt.sql' is scheduled to execute. Note that the final decision will be made later if you have a schema version specified for this script. Script Execution=RunOnInstall, Action=Install, Component State=Install, Schema=0001.00008.0000
1: The SQL script 'rollback.sql' is not scheduled to execute. Script Execution=RunOnRollback, Action=Install, Component State=Install, Schema=
1: Attempting to establish the SQL connection... Server: test Database:
1: Attempting to execute SQL scripts...
1: Determining if the SQL script 'struct.sql' will be executed...
1: The SQL script will be executed because no schema version is specified for this script.
1: Prepare executing SQL script file: 'test.sql'. Path: 'C:\Users\KONZUL~1\AppData\Local\Temp\~B898.tmp'
1: Executing SQL at Line 10 >>>
1: Executing SQL at Line 19 >>>
1: Executing SQL at Line 22 >>>
1:ADO Error: Number: -2147467259 Description: ORA-01430:
Source: Microsoft OLE DB Provider for Oracle SQL State: Native Error: 1430
1: There was a SQL scripting error at line 22. Continuing to the next batch.
1: Executing SQL at Line 25 >>>
1: ADO Error: Number: -2147467259 Description: ORA-01430:
Source: Microsoft OLE DB Provider for Oracle SQL State: Native Error: 1430
1: There was a SQL scripting error at line 25. Continuing to the next batch.
1: Executing SQL at Line 28 >>>
1: Executing SQL at Line 31 >>>
1: Executing SQL at Line 41 >>>
1: Executing SQL at Line 45 >>>
1: Executing SQL at Line 55 >>>
1: Executing SQL at Line 56 >>>
1: Finish executing SQL script file: 'test.sql'
1: Determining if the SQL script 'test2.sql' will be executed...
1: The SQL script will be executed because no schema version is specified for this script.
1: Prepare executing SQL script file: 'test3.sql'. Path: 'C:\Users\KONZUL~1\AppData\Local\Temp\~B8B9.tmp'
1: Executing SQL at Line 8 >>>
1: Executing SQL at Line 17 >>>
...
Скрипт должен сохранить в новый файл блоки лога, которые содержат слово Error (можно ADO Error: Number, блок будет начинаться со слова Prepare executing SQL script file, а заканчиваться словом Finish executing SQL script file. В итоге должно получиться что-то подобное:
...
---------------------------------------------
1: Prepare executing SQL script file: 'test.sql'. Path: 'C:\Users\KONZUL~1\AppData\Local\Temp\~B898.tmp'
1: Executing SQL at Line 10 >>>
1: Executing SQL at Line 19 >>>
1: Executing SQL at Line 22 >>>
1: ADO Error: Number: -2147467259 Description: ORA-01430:
Source: Microsoft OLE DB Provider for Oracle SQL State: Native Error: 1430
1: There was a SQL scripting error at line 22. Continuing to the next batch.
1: Executing SQL at Line 25 >>>
1: ADO Error: Number: -2147467259 Description: ORA-01430:
Source: Microsoft OLE DB Provider for Oracle SQL State: Native Error: 1430
1: There was a SQL scripting error at line 25. Continuing to the next batch.
1: Executing SQL at Line 28 >>>
1: Executing SQL at Line 31 >>>
1: Executing SQL at Line 41 >>>
1: Executing SQL at Line 45 >>>
1: Executing SQL at Line 55 >>>
1: Executing SQL at Line 56 >>>
1: Finish executing SQL script file: 'test.sql'
---------------------------------------------
...
Примечания:
В логе несколько таких блоков с ошибками. Сам лог достаточно большой.