Batch editing participant IDs

Leonid Spektor spektor at andrew.cmu.edu
Thu Aug 12 01:06:07 UTC 2021


Hi Elnaz,

For the number 4. you can try command chstring -w +t at Participants: +s"@Participants: * " "@Participants:STU " *.cha 

For the number 3., if each file or even each folder has its own unique ID*, then there isn't much automation you can achieve. You can create a batch file with multiple CHSTRING commands with different IDs pointing to different subdirectories of corresponding data files. But, to be more specific I need to know what system you are using, i.e. Mac or PC, and the layout of your data files directory tree structure.

I would suggest that you email to me directly instead of chibolts about it, since this is getting much more specific to your particular situation. My email address is spektor at andrew.cmu.edu.



Leonid.

> On Aug 11, 2021, at 20:17, 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 <https://l2trec.utah.edu/about/staff-directory.php>
> Second Language Teaching and Research Center (L2TReC) <https://l2trec.utah.edu/>
> University of Utah
> LinkedIn <https://www.linkedin.com/in/elnaz-kia?lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_contact_details%3B%2FResGVF2SMGMAxhocdPnRw%3D%3D>
> Personal Website <https://elnazkia.weebly.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 <mailto: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 <https://groups.google.com/d/msgid/chibolts/CAOwOJY%3Df6JUMXRFvKkshZ609pnWUq1tNHRsQbX_VKm8q7WxNuw%40mail.gmail.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/EC5A6E83-FC97-4C81-AA85-68163B21C005%40andrew.cmu.edu.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/chibolts/attachments/20210811/d3ab11b3/attachment.htm>


More information about the Chibolts mailing list