[Xsh-users] Problem using foreach
Brought to you by:
pajas
From: Joe P. <jPo...@cd...> - 2004-05-04 19:06:08
|
I'm using Xsh to edit a directory of Xml files Here's my script: $projIntake = "data/spreadsheet/out_2/out1"; foreach { glob("$projIntake/*.xml")}{ print "infile : $__"; $outFile = $__; print "outFile: $outFile"; open f=$__; foreach //Cell remove @StyleID; saveas f; }; This works as intended, but what I'd really like to do is preserve the input file and save the output to a different directory. Is there any way to change the value of $__? Attempting to assign the value of $__ to another varible is unsuccessful. Example: the result of the two print statements is infile : data/spreadsheet/out_2/out1/Caregivers99_Section_A.xml outFile: 0 infile : data/spreadsheet/out_2/out1/Caregivers99_Section_B.xml outFile: 0 infile : data/spreadsheet/out_2/out1/Caregivers99_Section_C.xml outFile: 0 Thanks for any help. Joseph Polanik Center for Demographic Studies, Duke University |