Count Number of Rows
How would I use Adeptia to count the number of rows in the file? I am using a advanced text schema to read the file. Here's an example:
E Document header Current Date
L Document Subheader Document Name
H Record 1 Data1 Data2
I SubRecord 1 Data1 Data2
I SubRecord 2 Data1 Data2
I SubRecord 3 Data1 Data2
O CaseSubRecord1 Extra Needed Info for this case
H Record 2 Data1 Data2
I SubRecord 1 Data1 Data2
H Record 3 Data1 Data2
I SubRecord 1 Data1 Data2
I SubRecord 2 Data1 Data2
I SubRecord 3 Data1 Data2
F Final Line of Document
In the above example there are 3 records, but 14 lines. I want the count for the 14 lines. The issue I’m running into is that O line, it is conditional when it is needed.
-
1) For each record type create a global variable "varRecordTypeCount". Example: "varHeaderCount"
2) The value for the varHeaderCount would be defined as count(xpath of record type) Example: count($Input_Schema_Test/Root/record-Header)
3) Create a global variable "varCount"
4) Set the value of varCount by adding all the previous global variables together. Example: $varHeaderCount + $varPolicyCount + $varInsuredCount
5) Now the total number of rows is stored in varCount0
Post is closed for comments.
Comments
1 comment