Perl Script to Convert a Progress Table Dump file to a CIM Load File

Written by James McDonald

September 14, 2012

Ran into a problem trying to load a .d file with the progress editor.  I think there was a unique index on the first first field of the msg_mstr table so I had to update the records using CIM from inside QAD.

This is the script I used to convert it from .d format to .cim.

#!/usr/bin/perl -w

open ( FH, "<msg_mstr.d") or die "Can't open File";

open ( OUT, ">msg_mstr.cim") or die "Can't open output";

while(<FH>) {

	# given this line in the msg_mstr.d file
	# 1576 "Lotus Notes does not fully support this option" \
        # "us" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
	# this regular expression will select the 1st three
        # values and store them in $1, $2 and $3
	$_ =~ m/(\d+)\s(\".*\")\s(\"\w{2}\")/;

	print OUT '@@batchload mgmsgmt.p' . "\n";

	print OUT "$3\n$1\n$2\n";

	print OUT '@@end' . "\n";




The above created the following CIM format.

@@batchload mgmsgmt.p 
"Lotus Notes does not fully support this option" 


Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…

Toggen builds a new website

So I have built and hosted a new website for Roger Clark Pest Management they are a family owned and operated Pest...


Just downloaded WizTree (not a sponsor) from It seems to do what it says on the tin which is...

Scam call from “Telstra”

Just had a call from a man with a sub-continental accent from caller ID 0734946596 Told me there was problem with my...