Replacements in dependent tiers

Leonid Spektor spektor at andrew.cmu.edu
Sun Jan 23 23:01:45 UTC 2022


Hi,

	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.

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":

chstring +t%dep +s"$code-1want-to-change" "$new-code"
chstring +t%dep +s"$code-1*" "$new-code*"

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.

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


Leonid.

> On Jan 23, 2022, at 15:06, remeig... at gmail.com <remeigonzalez at gmail.com> wrote:
> 
> Dear all,
> 
> We are trying to find a way to replace several codes we used in a dependent tier in many files, in order to create new files with these new codes.
> 
> As far as I know, the CHSTRING command with a .cut 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).
> 
> I would go with something like:
> 
> CHSTRING %dep “$code-Iwant-to-change” “resulting-code”.
> 
> 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?
> 
> 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?
> 
> Thank you in advance,
> 
> --
> 
> Remei González Manzanero 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups "chibolts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to chibolts+unsubscribe at googlegroups.com <mailto:chibolts+unsubscribe at googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/chibolts/303df79e-aed9-4a00-899a-735f85d62ccfn%40googlegroups.com <https://groups.google.com/d/msgid/chibolts/303df79e-aed9-4a00-899a-735f85d62ccfn%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups "chibolts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chibolts+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chibolts/256FDD67-B182-4331-9DF2-48B7344AEE81%40andrew.cmu.edu.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/chibolts/attachments/20220123/3d1b68a7/attachment.htm>


More information about the Chibolts mailing list