How can we extract lines appearing between { } in text file through batch file.
Name : ABC Place : xyz Data :dd/mm/yyyy {"return":"good","message":"ABC is present in xyz place","SSN":"-----------------345679HISKWBXMVTXVEULWXVC VBXSWGVXBWSDCXLWUDV"}
I tried using the below code snippet, However it lists all the contents of text file . How can we extract the contents within {}
for /f "tokens=*" %%x in (filename) do set extract=!extract!%%x
This might help you:
@echo off for /f "usebackq tokens=1 delims={}" %%a in ("Whateverfile.txt") do set "data=%%a" echo %data%
type for/? in cmd for more info or For-loop
1.4m articles
1.4m replys
5 comments
57.0k users