Append the new file with Trail-2.txt while replacing the string FAMILY-INSTANCE with the current line of file-list.txt.The core of the script would do the following: I just opened it in notepad++ and use alt select to select a box with just the instance names and saved that as file-list.txtĮssentially I think this can all be done in perl, or even a cmd file. The file list came from idx file when I backed up the generic to the folder. Not sure why, I think there's too much hard coded in it to work with the current rev of Creo.Īlso attached are my sample files and the resulting file I made manually to test the function of the longer trail file. I've use this in the past, but it's not working for what I need to do now. We could have hundreds or thousands of instances.Īttached is Edwin Muirhead's original Trail Maker.htm, which in reality is just a java script. I don't want to have to pick the instance manually when running the trail file. I need a function to replace a string in one of the trail files because I'm opening instances of a family table and doing something to each one then backing it up. ![]() idx file.Īnd removed the first of the problematic for /f statements - no need for it as you are calling batchsubstitute.bat just once.īut the key problem was that you were missing the CALL keyword - see line 8. I also shortened up some of the code that extracts the name of the generic from the. Ok, I see your problems and how the last two for /f statements didn't work.įor /F "tokens=2 skip=1 delims= " %%A IN (mass-parameter-update.idx) DO %%A > instance-list.txtĬall remove-last-line.cmd instance-list.txtįor /F "tokens=3 skip=1 delims= " %%A IN (mass-parameter-update.idx) DO (set generic_name=%%A)Įcho Ready to start the substitution - replacing GENERIC-PART.Ĭall batchsubstitute.bat GENERIC-PART %generic_name% trail-2.txt > trail-3.txtĮcho Ready to start the substitution - replacing FAMILY-INSTANCEs.įor /F "tokens=1" %%A IN (instance-list.txt) DO (call batchsubstitute.bat FAMILY-INSTANCE %%A trail-3.txt > big-trail-test.txt) Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist. You may also use "Start a topic" button to ask a new question. ![]() If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. This thread is inactive and closed by the PTC Community Management Team. Etc… until you get to the last line of file-list.txtĮssentially a for each command with text replacement and append the new file with the modified trail-2.txt each time.Trail-2.txt with the word FAMILY-INSTANCE replace with the third line of file-list.txt.Trail-2.txt with the word FAMILY-INSTANCE replace with the second line of file-list.txt.Trail-2.txt with the word FAMILY-INSTANCE replace with the first line of file-list.txt.Wondering if anyone has a batch file that will work with a trail file segment and a list of files to build a long trail file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |