Jump to content

Auto name the cfg & msg files


Kal

Recommended Posts

Is there a way for the .cfg & .msg files to output with the name of the input data filename?

 

Input Data file = datafile01.txt

cfg file needs to output name datafile01.cfg

msg file needs to output name datafile01.msg

Link to comment
Share on other sites

When I have to compose 10 to 40 different files, the company wants to keep each file it creates for "logging". To review if needed for errors. I really just need the .msg file with all the record counts. Or is there a way to create a text file with the unique input name with the same info as the .msg file?
Link to comment
Share on other sites

When I have to compose 10 to 40 different files, the company wants to keep each file it creates for "logging". To review if needed for errors.

It sounds like you're on the cusp of needing a more automated solution using FusionPro Server.

I really just need the .msg file with all the record counts. Or is there a way to create a text file with the unique input name with the same info as the .msg file?

I would use the XML log file for that. It's more easily parse-able than the main .msg log file.

 

In your OnJobStart rule, you can do this:

FusionPro.Composition.CreateXMLLogFile();

The XML log will be in the same location as the main .msg file, with the same name and ".xml" on the end.

 

Or you can do something like this, also in OnJobStart, to specify the path and name of the XML log:

FusionPro.Composition.CreateXMLLogFile(FusionPro.Composition.inputFileName + ".xml");

You could, of course, use any name you want, or redirect the XML log to any folder you want, for example:

FusionPro.Composition.CreateXMLLogFile("/custom folder/" + GetFileName(FusionPro.Composition.inputFileName) + ".xml");

 

Or, in FusionPro Server, you can add the "XMLLogFile=" setting to the CFG file, with the path, for any job, without having to add or modify the OnJobStart rule. Again, FP Server allows much more automation.

 

You might also consider adding some error handling to your templates, so that you don't compose "bad" output in the first place. On the Advanced tab of the Composition Settings, you can set the "Abort on Errors of This Type" and then an abort mode. Or you can call FusionPro.Composition.Abort() for any condition you want, in any rule.

 

I still don't understand why you need custom names for CFG files.

Link to comment
Share on other sites

Thanks Dan, I think we can work with the XML log file.

 

As for why, it's for a few of our clients that for some reason want log files of all of their composed files. We've been doing them manually by renaming the .msg files. I was hoping to avoid the manual part because it really slows us down and mistakes are made doing this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...