批量:修整批量处理的 sql 文件的输出

Batch: trimming an output of a sql file processed in batch

批次:

db2 -stwl%LOG% -f %SQL_DIR%\test.sql > %DATA_ROOT%\%NAME%.txt

SQL: 很长,所以我不会 post 在这里,它是一个巨大的 select 查询,给出了这个输出:

1                                                                                                                                                                                                                             

-----------------------------------------------------------------------------

A testline for example  <--these are the only lines i want to output            
and another one      <-- these are the only lines i want to output                                                           



  2 Satz/Sätze ausgewählt.

有没有办法将 txt 文件的输出最小化为我上面标记的 2 行? (不使用一些额外的 perl/other 外部代码)

可能类似于 db2 调用中的另一个字符,仅打印 2 行

您可能想看看 db2batch 及其输出选项。

  • 性能选项应为 0(零)
  • 查询选项应该打开

查看 db2batch manual 了解详情。