Batch editing participant IDs

Brian Macwhinney macw at andrew.cmu.edu
Thu Aug 12 01:48:11 UTC 2021


These changes seem okay.  I use regex expression changes in BBEdit instead of relying on CHSTRING for things like this, because it gives you fuller control. Similar options are Atom, Sublime Text and so on.

— Brian

> On Aug 11, 2021, at 8:17 PM, Elnaz Kia <ek325 at nau.edu> wrote:
> 
> Dear Leonid,
> 
> I have one more question about my recent inquiry. Per Brian's and your advice, I am in the process of changing the participant IDs and making other necessary revisions. In order to change the transcriptions from form A to form B (see below), I created the following commands. I couldn't find a more dignified path. :-) 
> Form A
> @Begin
> @Languages: fra
> @Participants: F0001 IDf0001 Student
> @ID: fra|corpus|F0001|0;00.00|male|||Student|||
> @Media: f0001c05ri4_1, audio
> @Transcriber: Matteo Fiorini
> @Comment: euh signals hesitation
> @Situation: Introductions
> *F0001: je m' appelle (..) NAME NAME (.) euh (.) . 
> *F0001: NAME c' est mon dernier nom [:: nom de famille] . 
> *F0001: et ça vienne <de> [/] de Allemagne parce que mon maman <et> [/] et
> mon papa est Allemagne [:: allemands] . 
> *F0001: <et alors je> [//] euh (.) alors mon dernier nom
> [:: nom de famille] NAME est Allemagne [:: allemand] . 
> @End
> 
> Form B
> @Begin
> @Languages: fra
> @Participants: STU IDf0001 Student
> @ID: fra|mussel|STU|0;00.00|male|||Student||IDf0001|
> @Media: f0001c05ri4_1, audio
> @Transcriber: Matteo Fiorini
> @Comment: euh signals hesitation
> @Situation: Introductions
> *STU: je m' appelle (..) NAME NAME (.) euh (.) . 
> *STU: NAME c' est mon dernier nom [:: nom de famille] . 
> *STU: et ça vienne <de> [/] de Allemagne parce que mon maman <et> [/] et
> mon papa est Allemagne [:: allemands] . 
> *STU: <et alors je> [//] euh (.) alors mon dernier nom
> [:: nom de famille] NAME est Allemagne [:: allemand] . 
> @End
> 
> 1. To change the participant ID in the main lines in chat & text files (applies to all languages):
> chstring +re +w +t* +l +s"\**:" "\*STU:" *.cha
> ren +re -f *.chstr.cex *.cha
>  
> chstring +re +w +y +s"\**:" "\*STU:" *.txt
> ren +re -f *.chstr.cex *.txt
> 
> 2. To change the corpus name and the next field in line @ID in chat & text files (applies to all languages):
> chstring +re +w +t@ +s"|corpus|*|" "|mussel|STU|" *.cha
> ren +re -f *.chstr.cex *.cha
>  
> chstring +re +w +y +s"|corpus|*|" "|mussel|STU|" *.txt
> ren +re -f *.chstr.cex *.txt
> 
> 3. To change the optional speaker name (last field) in line @ID
> *Note: These commands has to be run separately for each folder, since the ID changes in each folder.
> chstring +re +w +t@ +s"|Student|||" "|Student||IDc0002|" *.cha
> ren +re -f *.chstr.cex *.cha
>  
> chstring +re +w +y +s"|Student|||" "|Student||IDc0002|" *.txt
> ren +re -f *.chstr.cex *.txt
> 
> 4. To change the 1st field in line @Participant
> *Note: These commands have to be run separately for each folder, since the ID changes in each folder.
> Tried this command and a few others, no chance!
> chstring +w +d +s"F0010 IDf0010 Student" "STU IDf0010 Student" *.cha
> 
> Questions:
> a) how can I achieve the last change (4)?
> b) I am using batch to run the commands in 1 and 2 (highlighted in yellow). Is it possible to create the search strings for 3 and 4 in a way that it is not dependent on specific IDs so I could run all the commands in batch for all the directories and subdirectories instead of running them on individual folders?
> 
> I am so sorry for asking so many questions. I spend hours digging in the manuals and playing with the commands before asking you. :-(
> 
> Thank you so much for your help!
> Elnaz
> 
> 
> Elnaz Kia, Ph.D. (she, her, hers)
> Post-Doctoral Research Associate
> Second Language Teaching and Research Center (L2TReC)
> University of Utah
> LinkedIn
> Personal Website
> 
> 
> -- 
> 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/CAOwOJY%3Df6JUMXRFvKkshZ609pnWUq1tNHRsQbX_VKm8q7WxNuw%40mail.gmail.com.

-- 
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/AB2BBD34-2F3C-43A9-89AF-2C1E9F27C383%40andrew.cmu.edu.



More information about the Chibolts mailing list