<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">The strings that are matched by wild characters, like * and _, are not changed and are copied to the output. The best way to see what commands do is to try them on a small customized sample file. In regard to except words, there is no feature to do that. Except, do not include that word in search string and then search string will not match the word you want to exclude. CHSTRING allows to specify a file with different search and replace entries, so you can specify as many of those as you want. This will allow you to very specifically customize what word or part of string you want to match and which you want to exclude.<br class=""><div class="">
<br class=""><br class="">Leonid.
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Jan 25, 2022, at 16:27, remeig...@<a href="http://gmail.com" class="">gmail.com</a> <<a href="mailto:remeigonzalez@gmail.com" class="">remeigonzalez@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Good day, <div class="">Thank you very much for the fast reply. I really appreciate your help. </div><div class=""><br class=""></div><div class="">Now I understand what the +1 is for, I saw it in other commands used by other people but I didn't understand it. </div><div class=""><br class=""></div><div class="">Regarding to the specific command "chstring +t%dep +s"$code-1*" "$new-code*"", using the * would keep with no changes all the words contained in that *? So would this mean that I can replace specific parts of the old codes using this specific command? </div><div class=""><br class=""></div><div class=""><div class="">Another question that just came to me now is that: is there any way to use exceptions in the codes, such as changing a code that contains specific words except for one word? I'm not sure if I'm expressing myself right. <br class=""></div></div><div class=""><br class=""></div><div class="">Example: chstring +t%dep +s"$code-*want-to-change-EXCEPT 'SPECIFIC-WORD-I-DON'T-WANT-TO-CHANGE" "$new-code"<br class=""></div><div class=""><br class=""></div><div class=""><div class="">Thank you for offering giving the exact command lines. I believe for now it is okay, I will practice with the command before and I will let you know in the case we need more help. </div></div><div class=""><br class=""></div><div class="">Best regards, </div><div class="">--</div><div class="">Remei González Manzanero</div><div class=""><br class=""></div><div class="gmail_quote"><div dir="auto" class="gmail_attr">El lunes, 24 de enero de 2022 a las 0:01:48 UTC+1, Leonid Spektor escribió:<br class=""></div><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap:break-word;line-break:after-white-space" class="">Hi,<div class=""><br class=""></div><div class=""><span style="white-space:pre" class=""> </span>I will start with last question. The reason CHSTRING command outputs ".chstr.cex" filenames is so that you can check the output to see if changes were done correctly and nothing went wrong. If you really want to take a chance then add +1 option to the command line. Otherwise, after you verify that only right string were replaced correctly you can use command "ren -f *.chstr.cex *.cha" to change all output filenames to .cha.</div><div class=""><br class=""></div><div class="">For the first question CHSTRING command works on word bases by default. This means that the string that you want to replace has to completely match the code in the data file. For example, if you have codes "$code-1want-to-change" and "$code-2want-to-change", then following commands will replace only code "$code-1want-to-change":</div><div class=""><br class=""></div><div class=""><div class="">chstring +t%dep +s"$code-1want-to-change" "$new-code"<br class="">chstring +t%dep +s"$code-1*" "$new-code*"</div><div class=""><br class=""></div><div class="">Please notice the "+t%dep" option. It will guarantee that only codes found on %dep tier will be replace. The same string on other tiers will not be changed.</div><div class=""><br class=""></div><div class="">If you want a more detailed example, then you can email your sample file to me directly along with a list of codes you want to replace and I will give you the exact command line(s).</div><div class=""><br class=""></div><div class=""><br class="">Leonid.
</div>
<div class=""><br class=""><blockquote type="cite" class=""></blockquote></div></div></div><div style="word-wrap:break-word;line-break:after-white-space" class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 23, 2022, at 15:06, remeig...@<a href="http://gmail.com/" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=es&q=http://gmail.com&source=gmail&ust=1643231544407000&usg=AFQjCNEeKlIF4aSR1KzypLQ4J_E8Nk-HhA" class="">gmail.com</a> <<a href="" data-email-masked="" rel="nofollow" class="">remeig...@gmail.com</a>> wrote:</div><br class=""></blockquote></div></div></div><div style="word-wrap:break-word;line-break:after-white-space" class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><p class="">Dear all, </p><p class="">We are
trying to find a way <b class="">to replace several codes</b> we used in a dependent
tier in many files, in order to create new files with these new codes. </p><p class="">As far as I
know, the CHSTRING command with a <i class="">.cut </i>file containing a list of all the
replacements can be used for this purpose, but I’m afraid of going wrong and
replacing strings that we are not supposed to, specially in the case of complex
codes containing characters like : or – (although I believe they’re not
considered metacharacters in this case). </p><p class="">I would go
with something like: </p><p class="">CHSTRING %dep “$code-Iwant-to-change” “resulting-code”.</p><p class="">Is there
any other way to do it or is there any unique option I should use in the case
of using CHSTRING in dependent tiers? </p><p class="">Furthermore,
I noticed the next: when using CHSTRING command it gives me back as an output a
.chstr.cex file format. Is there any way to avoid this? </p><p class="">Thank you
in advance,</p><p class="">--</p><p class="">Remei González Manzanero </p><div class=""><br class=""></div></div></blockquote></div></div></div><div style="word-wrap:break-word;line-break:after-white-space" class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">
-- <br class="">
You received this message because you are subscribed to the Google Groups "chibolts" group.<br class="">
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="" data-email-masked="" rel="nofollow" class="">chibolts+u...@googlegroups.com</a>.<br class="">
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/chibolts/303df79e-aed9-4a00-899a-735f85d62ccfn%40googlegroups.com?utm_medium=email&utm_source=footer" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=es&q=https://groups.google.com/d/msgid/chibolts/303df79e-aed9-4a00-899a-735f85d62ccfn%2540googlegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&source=gmail&ust=1643231544407000&usg=AFQjCNGXy3eyJqDr9olRblGTstG5a8ftqQ" class="">https://groups.google.com/d/msgid/chibolts/303df79e-aed9-4a00-899a-735f85d62ccfn%40googlegroups.com</a>.<br class="">
</div></blockquote></div><br class=""></div></div></blockquote></div><div class=""><br class="webkit-block-placeholder"></div>
-- <br class="">
You received this message because you are subscribed to the Google Groups "chibolts" group.<br class="">
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:chibolts+unsubscribe@googlegroups.com" class="">chibolts+unsubscribe@googlegroups.com</a>.<br class="">
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/chibolts/d5f20104-033c-4d60-83b9-655673ba91e0n%40googlegroups.com?utm_medium=email&utm_source=footer" class="">https://groups.google.com/d/msgid/chibolts/d5f20104-033c-4d60-83b9-655673ba91e0n%40googlegroups.com</a>.<br class="">
</div></blockquote></div><br class=""></body></html>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "chibolts" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:chibolts+unsubscribe@googlegroups.com">chibolts+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/chibolts/38B1E495-1A94-47CE-BC9F-5D95E737D3EC%40andrew.cmu.edu?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/chibolts/38B1E495-1A94-47CE-BC9F-5D95E737D3EC%40andrew.cmu.edu</a>.<br />