I am making a batch script that creates a .json
script if it is not found in a specific location. If it needs to be made, I also have my batch script insert all of the default code for the JSON. I can make a 1:1 copy of the original I'm making the new one from, but I want to know if there's a faster way to do so without having to copy the code line for line with the current syntax that I'm using. I am inserting the code via the ECHO command in this manner:
ECHO %CODELINE%>> "%JSONSCRIPT%
I want to know if there is something I can do so that each line doesn't have to start with ECHO
and end with >> "%JSONSCRIPT%
. Is this possible? Here is a snippet from my script for one of the JSON files to be created:
:MAKEJSON
BREAK>"Scripts\JSON1.json"
ECHO {>> "Scripts\JSON1.json"
ECHO "list": [>> "Scripts\JSON1.json"
ECHO {>> "Scripts\JSON1.json"
ECHO "var": {>> "Scripts\JSON1.json"
ECHO "showName": "Example 01",>> "Scripts\JSON1.json"
ECHO "targetName": "TBD">> "Scripts\JSON1.json"
ECHO },>> "Scripts\JSON1.json"
ECHO "type": {>> "Scripts\JSON1.json"
ECHO "showName": "Example 02",>> "Scripts\JSON1.json"
ECHO "typeName": "[Test]",>> "Scripts\JSON1.json"
ECHO }>> "Scripts\JSON1.json"
ECHO },>> "Scripts\JSON1.json"
ECHO {>> "Scripts\JSON1.json"
ECHO "var": {>> "Scripts\JSON1.json"
ECHO "showName": "Test 2",>> "Scripts\JSON1.json"
ECHO "varName": "[Test2]">> "Scripts\JSON1.json"
ECHO },>> "Scripts\JSON1.json"
ECHO "type": {>> "Scripts\JSON1.json"
ECHO "showName": "Sampletext",>> "Scripts\JSON1.json"
ECHO "typeName": "TBD",>> "Scripts\JSON1.json"
ECHO }>> "Scripts\JSON1.json"
ECHO }>> "Scripts\JSON1.json"
ECHO ]>> "Scripts\JSON1.json"
ECHO }>> "Scripts\JSON1.json"