| 1. |
Solve : Batch file for Text File Read "surround" and Write? |
|
Answer» I have some simple text files that contain the file paths for folders and sub folders. My current batch file creates the folder with a list of the file paths. This is the command I am using to make the files: Try this: Dusty, Thank you, that works perfectly! I am only going to add a few things so as to create a temp file that can be deleted and to create a new file each time. This is to create a Search.pro file for ProEngineer so that it can find exactly where it needs to look for all of the parts of an assembly each time AUTOMATICALLY when a file is opened. It'll save a lot of time for people importing new assemblies to their computer so that they can keep their standard Config.pro file and simply create new search.pro files when they open an assembly. Long story with the ProEngineer side of things, but needless to say this will make my life a lot easier. Thanks again for your help! SEBNN Oh, and so someone can see what the code looks like, it is below. Code: [Select]echo !TrialFile >TrialFile.txt dir /ad /s /b >>TrialFile.tmp echo off cls for /f "Delims=" %%a in (TrialFile.tmp) do ( echo "%%a" >>TrialFile.txt ) del .\TrialFile.tmp Like I said, it works great and I have tested it multiple times. Also, as an explanation, the ! in the code is to indicate to ProEngineer that the CHARACTERS following it are a comment and to write SOMETHING other than a blank line when the file is cleared for the first run.Thanks for coming back to report your success and post your coding. D. |
|