you need to use message split in mapping to create multiple messages, and in turn multiple files for every value change
for example,
message type for source and target
Image may be NSFW.
Clik here to view.
use SplitByValue on each value change as below
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
when execute this mapping the result will be as below,
Image may be NSFW.
Clik here to view.
your message type could be different based on your exact requirements, but as Raghuraman has already mentioned , with group and split by value you should be able to achieve this.