I need to read in the string from input file and reform it by cut each segment and check the last segement lenght. If the last segment length is not as expected (see below segment file or table. It is predefined), then pad enough space.
Old string
FU22222222CA6666666666AKxvbFMddreeadBP999
new string
FU22222222CA6666666666AKxvbFMddreead
BP999 &&
Segment table
id length
-----------------
FU 10
CA 12
AK 5
FM 9
BP 20
Thanks