Thank you again Steve
HSBC have given us a sample of the file they need to receive. It's a text file. Should the codeunit be different altogether if this is the case? I don't know if this will format correctly when I submit it, but I've pasted below the sample text from the file they sent me.
VOL109EM00 BACSNO 1
HDR1ABACSNOS 1BACSNO09EM0000010001 20001 20005 000000
HDR2F0200000100 00
UHL1 20002999999 000000001 DAILY 001
1234561234567809912345612345678 00000000001DEBIT COMPANY REF FOR BENE BENE NAME
1234561234567809912345612345678 00000000001DEBIT COMPANY REF FOR BENE BENE NAME
1234561234567809912345612345678 00000000001DEBIT COMPANY REF FOR BENE BENE NAME
1234561234567809912345612345678 00000000001DEBIT COMPANY REF FOR BENE BENE NAME
1234561234567801712345612345678 00000000004REF FOR DEBIT ACC CONTRA DEBIT COMPANY
EOF1ABACSNOS 1BACSNO09EM0000010001 20001 20005
EOF2F02000000100 00
UTL10000000000004000000000000400000010000004