有什么方法可以在没有其他详细信息的情况下获取假脱机文件数据(页码、报告行结尾、文件详细信息行)
我的代码:
AS400 sys = new AS400();
SpooledFile sf = new SpooledFile( sys, // AS400
SPLFNAME, // splf name
SPLNO, // splf number
JOBNAME, // job name
JOBUSER, // job user
JOBFNUMBER );
PrintParameterList printParms = new PrintParameterList();
printParms.setParameter(PrintObject.ATTR_WORKSTATION_CUST_OBJECT, "/QSYS.LIB/QWPDEFAULT.WSCST");
printParms.setParameter(PrintObject.ATTR_MFGTYPE, "*WSCST");
PrintObjectTransformedInputStream is = sf.getTransformedInputStream(printParms);
BufferedReader d = new BufferedReader(new InputStreamReader(is));
String data = "";
while((data = d.readLine()) != null)
{
System.out.println (data);
jTextArea1.append(data + "\n");
}
输出假脱机文件:
PROGRAM ID: XXXXXXX COMPANY NAME 1 REPORT DATE: 9/27/13 PAGE: 1
USER : XXXXXXX Loan file list REPORT TIME: 12:59:53
ID NAME
--------------------------------------------------------------------
01 AAAAAAA
02 BBBBBBB
03 CCCC
04 DDDDDDD
PROGRAM ID: XXXXXXX COMPANY NAME 1 REPORT DATE: 9/27/13 PAGE: 2
USER : XXXXXXX Loan file list REPORT TIME: 12:59:53
ID NAME
--------------------------------------------------------------------
05 EEEEEEE
06 FFFFFF
07 GGGGGG
08 HHHHHHH
************************** End of Report ***************************
我想得到这样的输出:
ID NAME
--------------------------------------------------------------------
01 AAAAAAA
02 BBBBBBB
03 CCCC
04 DDDDDDD
ID NAME
--------------------------------------------------------------------
05 EEEEEEE
06 FFFFFF
07 GGGGGG
08 HHHHHHH
或者 :
01 AAAAAAA
02 BBBBBBB
03 CCCC
04 DDDDDDD
05 EEEEEEE
06 FFFFFF
07 GGGGGG
08 HHHHHHH
有人知道怎么做吗?使用更新我的 JT400 Java 代码或格式化这个假脱机文本文件