我有一个以逗号分隔的源平面文件,文件的标题带有 start date 和 end date ,下一行包含所有文件名,并继续源文件的数据示例:
"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 的长字符串读取,然后我想使用 Java 转换并将它们与分布在多个标题中的列名拆分,并将它们与下面的值相关联。一个输入行将登陆尽可能多的目标行。
第一件事:将文件逐行读入一个长字符串端口。
将“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..