我有以下要求,但我不能對方法決定採取行的變量數:彈簧批量多行記錄項作家,每個記錄
我需要將數據寫入到一個固定的格式進行放文件,其中每個記錄跨越多行,如下所示:
000120992599999990000000000000009291100000000000000000000000010000
000000000000000000000006050052570009700000050000990494920000111100
ABCDE:WXYZ 0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
000000000000000000000006050052730005700001100000090494920000221200
ABCDE:WXYZ 0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
000000000000000000000006050113110009700000000000000494920000311100
ABCDE:WXYZ 0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
000012099259999999000000000000000929110000000000000000000000001000
這是從例如上述的一個記錄:
000000000000000000000006050052570009700000050000990494920000111100
ABCDE:WXYZ 0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
descriptiongoesheredescriptiongoesheredescriptiongoesher0200
第一和最後一行是報頭和Foo ter分別。 每條記錄的第一行包含幾個細節。 第二行有一些其他的空間細節。
我有一個很長的描述字段,我需要分成56個字符部分,並附加記錄的第3行向前。
所以在一些記錄中,這可能只是一條線,而在一些記錄中也可能是三條線。
我需要關於如何在上述場景中設計我的作品的指導。
聶
謝謝邁克爾..通過例子! – Nik
它工作。謝謝!! – Nik