コンマで区切られたソース フラット ファイルがあり、ファイルには開始日と終了日のヘッダーがあり、次の行にはすべてのファイル名があり、ソース ファイルのデータ例が続きます。
"2015-05-09","2015-06-05"
"CARRIER ","CONTRACT ","ELGBL/GRP "," ","TOTAL FEES","TOTAL FEES ","PMPM ACA ","PMPM ACA ","RETAIL ","RETAIL ","MEDICAID ","MEDICAID ","STATE ","STATE ","MAIL SERVICE","MAIL SERVICE","RETAIL ","RETAIL ","POSTAGE - ","POSTAGE - ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","SYSTEM ","OTHER ","OTHER "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","
" "," "," "," ","COUNT ","AMOUNT ","METAL ","METAL ","DIRECTS ","DIRECTS "," "," ","HEALTH ","HEALTH ","CLAIMS ","CLAIMS ","PHARMACY ","PHARMACY ","BULK ","BULK ","MCRCF ","MCRCF ","MCRCP ","MCRCP ","MPA ","MPA ","MRXC ","MRXC ","PPACA ","PPACA ","QPC ","QPC ","RXSEL ","RXSEL ","SPCR ","SPCR ","COUNT ","AMOUNT "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","
" "," "," "," "," "," ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT ","COUNT ","AMOUNT "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","
"1234 ","ABCD5678 ","ABCOEFITEST1 "," "," 1"," 1.60"," 1"," 1.60"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
"1234 ","ABCD5678 ","ABC200074002 "," "," 6"," 3.20"," 2"," 3.20"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 4"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
"1234 ","ABCD5678 ","ABC200178002 "," "," 2"," 1.60"," 1"," 1.60"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 1"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
"1234 ","ABCD5678 ","ABC200197001 "," "," 1"," 1.60"," 1"," 1.60"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
"1234 ","ABCD5678 ","ABC200204002 "," "," 2"," 3.20"," 2"," 3.20"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
"1234 ","ABCD5678 ","ABC200204003 "," "," 2"," 3.20"," 2"," 3.20"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
"1234 ","ABCD5678 ","ABC200232002 "," "," 4"," 1.60"," 1"," 1.60"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 3"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
"1234 ","ABCD5678 ","ABC200300001 "," "," 7"," 1.60"," 1"," 1.60"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 6"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
"1234 ","ABCD5678 ","ABC200345002 "," "," 1"," 1.60"," 1"," 1.60"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
"1234 ","ABCD5678 ","ABC200414001 "," "," 9"," 3.20"," 2"," 3.20"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 7"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
"1234 ","ABCD5678 ","ABC200491003 "," "," 1"," 1.60"," 1"," 1.60"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00"," 0"," 0.00","
だから今、私はそれを1000精度の1つの長い文字列として読んでいます.Java変換を使用して、複数のヘッダーにまたがる列名でそれらを分割し、それらを下の値に関連付けます。1 つの入力行がターゲット行と同じ数になります。
最初に:ファイルを1行ずつ長い文字列ポートに読み込みます。
ソースに「CurrentlyProcessedFileName」ポートを追加して、ファイル名を取得します。
読み取った行数をカウントする
行をコンマで分割します-これをどのように実装しますか?? 式またはJava変換を推測し、Javaで以下のプロセス全体を推測するか、 SP を使用できますか、コンマで行を分割するにはどうすればよいですか??
If Current RowNumber = 1 Then
vINVC_BGN_DT := field1
vINVC_END_DT := field2
If Current RowNumber > 1
If field1 != $$CARRIER Then
NAME1 := NAME1 || field1 #Initialize NAME variables to an empty string
NAME2 := NAME2 || field2
NAME3 := NAME3 || field3 #repeat for each comma seperated field
If field1 = $$CARRIER Then
VALUE1 := field1
VALUE2 := field2
VALUE3 := field3 #repeat for each comma seperated field
ソース行ごとに、出力行の数は個別の Amount_types の数と等しくなければなりません (空のものを除く)。
For i in NAME4.NAMEx loop
if NAMEi is not spaces or null then generate row
target.INVC_TYPE = "CLAIM"
target.FILE_RECEIPT_SK
target.CARRIER := VALUE1
target.CNTRCT := VALUE2
target.PBM_GROUP := VALUE3
target.INVC_BGN_DT := vINVC_BGN_DT #From row1
target.INVC_END_DT := vINVC_END_DT #From row1
target.INVC_AMOUNT_TYPE := NAMEi
target.INVC_AMOUNT := VALUEi
end i loop..