Here are two Perl one-line scripts that illustrate how to manipulate an LDIFDE export file, converting it to an import file.
Each of the export files massaged by the scripts below contained only one or more records consisting of the dn: and changetype: fields, separated by a blank line. The ldifde command that created the export files specified a nonexistent property with the -l parameter so that no properties would be output.
The first script adds the msExchMasterAccountSid property with the SELF SID.
perl -pe "s/: add/: modifynadd: msExchMasterAccountSidnmsExchMasterAccountSid:: AQEAAAAAAAUKAAAA/;s/^$/-n/;" export.tmp > import.tmp
The second scripts deletes the msExchMasterAccountSid property.
perl -pe "s/: add/: modifyndelete: msExchMasterAccountSid/;s/^$/-n/;" export.tmp > import.tmp
The '-' at the end of each record is added with the s/^$/-n/ substitution.