write wxc file to LDM with proper pattern