Jump to content

OnRecordStart - New file with only part of Field change


jcaloway

Recommended Posts

My data file has a field that has two parts

I only want to create a new output file when the first part of the data changes. See the sample data below.

 

Can I use an array to only create a new output file when T1 changes to T2 or do I need to split my data into two fields before using it into FusionPro?

 

Sample data looks like (Sack and Pa is one data field currently)

Sack and Pa

T1 P1

T1 P1

T1 P2

T1 P2

T2 P1

T2 P1

T2 P2

...

...

 

 

Thanks in advance for any help you can provide

Link to comment
Share on other sites

Sure, you can do something like this in OnRecordStart:

var thisFieldPart = Field("Sack and Pa").split(/\s+/)[0];
var previousFieldPart = FusionPro.PreviousRecordFields["Sack and Pa"].split(/\s+/)[0];
if (thisFieldPart != previousFieldPart)
   FusionPro.Composition.OpenNewOutputFile(thisFieldPart + "." + FusionPro.Composition.outputFormatExtension);

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...