Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Tags importing => Auto fill values pre-processing (Read 186 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Tags importing => Auto fill values pre-processing

Hi, I'm needing to somehow remap textual input written to tags by import pattern after it's components are assigned to tag names.
Now some of the extracted components are not in final form, for example have newlines mapped to specific sequence and it's necessary to interpolate the text before it's written to assigned tag, by a foobar func, like $replace(...).
For example if the input scheme is %tracknumber%. %artist% - %title% (%comment%), I would need something like
%tracknumber%. %artist% - %title% ($replace(%comment%,$chr(30),$chr(13))), but it apparently doesn't make sense neither it works.

Is there a way to apply the conversion directly into parsing pattern, or perhaps using a different function, or plugin? I've checked masstager which has something similar but again it does work on principle of direct mapping.

Re: Tags importing => Auto fill values pre-processing

Reply #1
Write the $replace() function in Source: Other. It's $char(). Don't write functions in the pattern, it can only take a series of field names. Output a unique delimiter between parts of the Source: Other that are to become fields to make the Pattern unambiguous. The same can be done in Masstagger using Guess value from other fields, or Format value from other fields one field at a time.

Re: Tags importing => Auto fill values pre-processing

Reply #2
Write the $replace() function in Source: Other. It's $char(). Don't write functions in the pattern

Oh yeah, writing any functions in the pattern makes mess. But what if the source is clipboard, not in metadata. Looks to me like it needs to run in two passes, first raw import then secondly extrapolate/postprocess by whatever of the two methods. That's bearable but would it be possible doing in single step or single saveable batch, eg. in MassTagger? I'm afraid MT doesn't provide clipboard as direct source.

Re: Tags importing => Auto fill values pre-processing

Reply #3
You should save the data into a temporary field and delete it later.

In Masstagger you can use "Input data" to paste from the clipboard and direct it to a field. Then add more actions to operate on it. And then delete the field. By stacking multiple actions you can create more complex scripts that are still understandable. The temporary field will only exist in memory if it is deleted in the same script. But there isn't much difference compared to deleting it by hand. Most of the time will be spent writing the script, or making sure the clipboard lines match the files.

 
SimplePortal 1.0.0 RC1 © 2008-2021