Find the starting position in a file

I have a file called "INPUT" which takes the following format

MNT-BANK-NUMBERO:006,00:N
MNT-100-ACCOUNT-NUMBERO:018,00:N
MNT-1000-DESCRIPTIONO:045:C
.
.
.
Now i got to find the displacements of the account numbers of each field of a file.

For the field MNT-BANK-NUMBERO:006,00:N, the account number starts from position 1 and ends at 6.
For the field MNT-515-ACCOUNT-NUMBERO:018,00:N, the account number starts from position 7 and ends at 24. Likewise for all other fields. Now I have to find the starting positions of all the fields with account numbers.

The output should take the following format

INPUT , 1, 7, and so on

Could you please help me out in solving this. Thanks

Help Help Help ....

Your directions contradict each other. What EXACTLY determines the start and and of the account field?

It cannot be "MNT" that occurs at position 1 in both examples.

Well, I do apologise for giving you a hard time. Actually i was in a hurry

     For file INPUT, it takes the following format

MNT-BANK-NUMBERO:006,00:N
MNT-515-ACCOUNT-NUMBERO:018,00:N
MNT-515-DESCRIPTIONO:045:C

For file OUTPUT, it takes the following format

     D-CHECK-NUM:012:C
         D-COMMENT-LINE1:020:C
         D-COMMENT-LINE2:020:C
         D-COMMENT-LINE3:020:C
         D-TRAN-ORDER:012:C
         MON-ACCOUNT:018,00:N
         MON-BANK-NBR:006,00:

    MON-BLK-ITEM-SEQ:006,00:N
         MON-BLK-SEQ:004,00:N
            


    Here, for the file INPUT we have 3 fields MNT-BANK-NUMBERO:006,00:N, MNT-515-ACCOUNT-NUMBERO:018,00:N and MNT-515-DESCRIPTIONO:045:C and so on.

For MNT-BANK-NUMBERO:006,00:N field, the bank number is of 6(1-6) characters in length.
For MNT-515-ACCOUNT-NUMBERO:018,00:N field, the account number is of 18(7-24) characters in length.

Here, for the file OUTPUT we have 2 fields MON-ACCOUNT:018,00:N, MON-BANK-NBR:006,00:N:018,00:N and so on.

For MON-ACCOUNT:018,00:N field, the account number is of 18(86-103) characters in length.
For MON-BANK-NBR:006,00:N:018,00:N field, the bank number is of 6(104-109) characters in length.

Now my requirment is to find the starting position of each BANK NUMBER and the ACCOUNT NUMBER side by side

Typical Output looks like this

INPUT,1,7,
OUTPUT, 86, 104

I hope this gives you a clear picture. If not please let me know. Thanks

---------- Post updated at 10:59 AM ---------- Previous update was at 10:44 AM ----------

Help Help Help

(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post or send a private message where your goal is to get an answer more quickly.

Forum Rules: UNIX and Linux Forums - Smilies

For urgent matters, you could try: http://www.unix.com/emergency-unix-linux-support-help-me/

Regards,
Alister

I dont have access to emergency forums.

---------- Post updated at 12:36 PM ---------- Previous update was at 11:21 AM ----------

Help ..