problem when using '|' to pipe command lines.

Brian MacWhinney macw at cmu.edu
Thu May 31 12:19:45 UTC 2012


Dear Y. J.,
    The piping symbol is intended to be used in a single command within a single line.  It passes
data from one program to the next through a "data pipe".  It is not relevant to batch file usage.  
In your case, you want each of these commands on a separate line.  You can put these in a 
batch file, but if you use the -re switch properly, my guess is that you could just do this all through
a few commands you type in.  You may also want to use the +1 switch to avoid cluttering up your
folders with intermediary files.  But make sure you copy the whole corpus first in case the +1 switch 
makes an error.

For this type of work, you may also want to use a REGEX editor such as BBEdit that gives you more
power than CHSTRING.

-- Brian MacWhinney

On May 31, 2012, at 11:33 AM, Huang Y.J. wrote:

> Dear Mr./Ms:
> 
> Hello, I am using CLAN under Windows7 to do POS grammar pattern search
> for a large corpus about 55 texts of 2000,000 words. In order to tag
> and all the files with mor at once and then do frequency and
> concordance search, I try to simplify the procedure by using pipe bar
> ‘|’ for multiple command lines.
> 
> E.g. In order to change the Language and ID code names systematically
> from ‘en’ to ‘eng’ through multi-files, and then following the mor and
> post commands for tagging, I tried to combine the commands together to
> run them in a batch by using ‘|’ in between each command line.
> 
> When the command lines are executed together in a pipe line, some
> errors occurred as the below.
> " Can't create file *.CHSTR.chstr.cex", perhaps it is opened by
> another application "
> (But when each command line is executed separately, the result is
> smooth and correct.)
> 
> I was wondering do you know what the problem is and how I can solve
> it? Or is there any other way that I can simplify the tagging and
> searching procedure in a batch for multiple files? (expecting to be a
> growing corpus of 50~100 files in 4~7 folders.)
> Thank you.
> 
> Best,
> Huang Y.J.
> 
> The pipe command lines I used and the result as the following:
> 
> textin *.txt | chstring +s"en" "eng" *.cha +w +t at ID -t* | chstring
> +s"en" "eng" *.chstr.cex +w +t at Languages -t* | mor *.*chstr.chstr.cex
> | post *.*chstr.chstr.mor.cex
> 
> The feedback message from CLAN:
> textin *.txt
> Mon May 28 00:11:56 2012
> textin (21-Feb-2012)
> ****************************************
> From file <Test.txt>
> Done with file <Test.txtin.cha>
> From string "en" to string "eng"
> Can't create file "*.chstr.cex", perhaps it is opened by another
> application
> From string "en" to string "eng"
> Can't create file "*.CHSTR.chstr.cex", perhaps it is opened by another
> application
> Can't create file "*.*CHSTR.CHSTR.mor.cex", perhaps it is opened by
> another application
> 
> Using file:      C:\Program Files\CHILDES\CLAN\lib\English Grammar
> (mor)\post.db.
> 
> Mon May 28 00:11:56 2012
> post (21-Feb-2012) is conducting analyses on:
>  ALL speaker tiers
> ****************************************
> From pipe input
> the file "*.*CHSTR.CHSTR.MOR.pst.cex" cannot be opened or created
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups "chibolts" group.
> To post to this group, send email to chibolts at googlegroups.com.
> To unsubscribe from this group, send email to chibolts+unsubscribe at googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/chibolts?hl=en.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups "chibolts" group.
To post to this group, send email to chibolts at googlegroups.com.
To unsubscribe from this group, send email to chibolts+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/chibolts?hl=en.



More information about the Chibolts mailing list