Forums: Open Discussion (Thread #24493)

【バッチFW】固定長ファイル(改行コードなし)の出力について (2009-11-06 18:13 by Anonymous #46858)

お世話になります。

1レコードが固定長で、改行コードがないファイルを出力する事は可能でしょうか?
(横にずっとつながるイメージ)
FileFormatのlineFeedCharに""を指定すると、デフォルトの動作になってしまいます。

ご教示いただけたら幸いです。

Reply to #46858×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】固定長ファイル(改行コードなし)の出力について (2009-11-24 13:26 by taromaru #47144)

フレームワークから提供しているFileLineWriterでは、
「改行しない」という設定は出来ません。
・空文字->デフォルト
・\r, \n, \r\n ->設定通り
(1~2文字のStringなら設定通りになるので、
想定した使用方法ではありませんが空白1文字を挟む等はできると思います)


改行コードも空白も無しで、データを繋げるには、以下のようにします。
(改行しないというフォーマット上、
ヘッダやトレーラは出力しないものと仮定しています。)

1. AbstractFileLineWriterのサブクラス(XxxFileLineWriter)を継承し、
AbstractFileLineWriter#getLineFeedCharをオーバーライドする。
コードは、「return "";」のみ。

2. ジョブBean定義ファイルで、FileLineWriterを、1で用意したものに差し替える

もし、
AbstractFileUpdateDAOのサブクラス(XxxFileUpdateDAO)を利用している場合は、
既存のAbstractFileUpdateDAOのサブクラスを見れば、
見よう見まねで作成できると思います。
(使用するAbstractFileLineWriterのサブクラスが異なるだけです。)
Reply to #46858

Reply to #47144×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】固定長ファイル(改行コードなし)の出力について (2009-12-18 16:54 by Anonymous #47496)

お世話になります。

では、固定長ファイル(改行コードも空白も無し)の"読み込み"の場合は
以下の様な方法で可能なのでしょうか?

AbstractFileLineIteratorのサブクラスを継承し、AbstractFileLineIterator#getLineFeedCharをオーバーライド、
コードは、「return "";」のみ。

どなたかご教授お願い致します。
Reply to #46858

Reply to #47496×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login