I have a string composed by several fields. Two of which will always vary in length. I could simply use substring if all fields have fixed lengths.
Sample:
48001MCAbastillas2200800046300017100518110555130000123
The fields are divided like this:
480 | 01 | MCAbastillas | 2200800046300017 | 100518 | 110555 | 130000 | 123
The bolded fields are the fields that varies in length. They represent a name and a amount, respectively. I already posted this question but I mistakenly tagged it with Java. I tried to interpret the provided answers into Javascript but being no expert in it, I spent all day producing no results :(