<div dir="ltr"><div><pre>Dear Patrick and community,<br><br>regarding the previous issue, i think the question was perl related more, rather than catmandu itself.<br><br>How one can combine a fix with a test, out of being forced to use a fix in a perl program.<br><br>My guess is that something like if i change tag 245, i store this value in an array, <br><br>and then<br><br>with something like <span>is_deeply</span><span>(</span><span> $got</span><span>,</span><span> </span><span>{</span><span> array </span><span>=></span><span> bag</span><span>(</span><span>qw</span><span>/</span><span>the values you expect</span><span>/),</span><span> </span><span># and other expected values</span><span> </span><span>}, one can test the fix she implemented.<br><br></span><span></span><br>The example provided by <i>Johann,</i> instead of doing the below, how one could give as input a txt file named OldNames.csv and the replacements be in a file named NewNames.csv?<br><br>do marc_each()
    if marc_match(100a,"OldName")
        marc_set(100a,"NewName")
    end
    if marc_match(245a,"OldTitle")
        marc_set(245a,"NewTitle")
    end
end<br><br>I know regexes work in the if marc_match, do they also work in the marc_set?</pre><pre>do marc_each()
    if marc_match(100a,"(Old)(N)(ame)")
        marc_set(100a,"$1G$3")</pre><pre><br><br>last, i do not know how to produce a clean report, <br>say i wanted to have a txt file with all 001 values, or a tag that is repeatable....<br><br>i noticed</pre><pre>catmandu convert --fix 'retain(_id)' MARC to YAML < file_0.mrc<br><br>has an output that adds for example ' character, when we have a digit<br><br>---<br>_id: '120090304134844'<br>...<br>---<br>_id: recorda<br>...<br>---<br>_id: recordb<br>...<br>---<br>_id: recordc<br>...<br>---<br>_id: recorde<br>...<br>---<br>_id: '8797989999140813'<br><br>Is there a way to have just the values, in a row by row format?<br><br>Best</pre></div></div>