Hello,
It will be perfect if I can get some help, because I'm stuck with this powerful script..
Here is a piece of code :
Code: Select all
{"announcement":{"id":32322,"category":0,"layout_type":0,"title":"Campagne !","banner":"https://test.com/pics1.png?Expires=1592926851\u0026Signature=lBAIkBz3rrMHCBDHHPCnUk515Xoa~MtbB4Xsw4SCoFgrlkLojJjhNcOCrFx8LET3T1SQAVFYFYGYkrED2E5BiBpF48XJAWiN02RgyJY80JIeQDE2WTh04784OqnZRwQG3DkmmVfQNLjNxFAFeRWms~942r2qxIpQ-5tZojMVlNO9molhbGwnCwydXN4957r1s2EJ5LsRlHnxHySBB4nRZzAUCUFrPwrQBqFf0ZCkU-P0y-J80vcGTaCCI6TKmwvGZyeatEoPezqqiSFLwKgeF42z05Y-9kO5jbkOqHfgfAkBbohNn5pdNIfSHy44PuwFqex4XZlDnRofdqSZXZigKQ__\u0026Key-Pair-Id=APKAI5CNWVPOYRVLGC6Q","description":"\"Hello ! \r\n Join our community","start_at":1592784000,"new_appear_at":0,"is_new":false,"announcement_tab_id":1,"bodies":[{"layout_type":0,"image":"https://test.com/pics2.png?Expires=1592926851\u0026Signature=ggI1Aho0G2cdGEcn86-5b8gf~h1sPa0jwefexQO1hPLK~lAOxxsm8cuWS~2u8SUeNYd9zLUYPjqHQLyr5zA0vl08mBIPrl6v6IL9vER~5g8ununnxwyLAbRFIKXQtG1yaZj0QJBel9TJEspB0WTutbu5cDBW4~3Tb3jK7NKCLQt1ze4ZuTGszVmehz7V4SGuPtxyeQnOR1u1HuMbcsOHRfKJKdJ~X~hDAWDXSbXhXk3UrbpJngEO3nrYXDye93n0dtUDSGjpZ5Ebjq-iHCJ-9S4Hr0XF1KHvkYj6YPoz~Ql1W~qqbTX4PsX-3c34cXWt0dmDj4iACa2fVpb~p-eIWg__\u0026Key-Pair-Id=APKAI5CNWVPOYRVLGC6Q","description":"\r\n{center: begin}{size : 30}{outline : #000000 , 2}{shadow: #FFCC00, 3, 4, 5}\"{shadow: #FFCC00, 3, 4, 5}{color : #4B76F2}Check 1-2 {color}\r\n{shadow: #FFCC00, 3, 4, 5}{size : 20}News\" {size}\r\n{size : 28}available !{size}{outline}{shadow}{color}{center}\r\n\r\nJREPL ROCKS !\r\n\r\n"}
Here is a cleaned version to be more pretty :
Code: Select all
{"announcement":
{"id":32322,
"category":0,
"layout_type":0,
"title":"Campagne !",
"image":"https://test.com/pics1.png?Expires=1592926851\u0026Signature=lBAIkBz3rrMHCBDHHPCnUk515Xoa~MtbB4Xsw4SCoFgrlkLojJjhNcOCrFx8LET3T1SQAVFYFYGYkrED2E5BiBpF48XJAWiN02RgyJY80JIeQDE2WTh04784OqnZRwQG3DkmmVfQNLjNxFAFeRWms~942r2qxIpQ-5tZojMVlNO9molhbGwnCwydXN4957r1s2EJ5LsRlHnxHySBB4nRZzAUCUFrPwrQBqFf0ZCkU-P0y-J80vcGTaCCI6TKmwvGZyeatEoPezqqiSFLwKgeF42z05Y-9kO5jbkOqHfgfAkBbohNn5pdNIfSHy44PuwFqex4XZlDnRofdqSZXZigKQ__\u0026Key-Pair-Id=APKAI5CNWVPOYRVLGC6Q",
"description":"\"Hello ! \r\n Join our community",
"image":"https://test.com/pics2.png?Expires=1592926851\u0026Signature=ggI1Aho0G2cdGEcn86-5b8gf~h1sPa0jwefexQO1hPLK~lAOxxsm8cuWS~2u8SUeNYd9zLUYPjqHQLyr5zA0vl08mBIPrl6v6IL9vER~5g8ununnxwyLAbRFIKXQtG1yaZj0QJBel9TJEspB0WTutbu5cDBW4~3Tb3jK7NKCLQt1ze4ZuTGszVmehz7V4SGuPtxyeQnOR1u1HuMbcsOHRfKJKdJ~X~hDAWDXSbXhXk3UrbpJngEO3nrYXDye93n0dtUDSGjpZ5Ebjq-iHCJ-9S4Hr0XF1KHvkYj6YPoz~Ql1W~qqbTX4PsX-3c34cXWt0dmDj4iACa2fVpb~p-eIWg__\u0026Key-Pair-Id=APKAI5CNWVPOYRVLGC6Q",
"description":"\r\n{center: begin}{size : 30}{outline : #000000 , 2}{shadow: #FFCC00, 3, 4, 5}\"{shadow: #FFCC00, 3, 4, 5}{color : #4B76F2}Check 1-2 {color}\r\n{shadow: #FFCC00, 3, 4, 5}{size : 20}News\" {size}\r\n{size : 28}available !{size}{outline}{shadow}{color}{center}\r\n\r\nJREPL ROCKS !\r\n\r\n"}
I need this to be converted to html, to be more precise I want to remove all the lines except "image" and "description"
I dont know how to do this and if it's possible to remove all entries except the ons that contain these 2 words.
I want to replace too :
"image":"https://test.com/pics1.png?Expires=1592926851\u0026Signature=lBAIkBz3rrMHCBDHHPCnUk515Xoa~MtbB4Xsw4SCoFgrlkLojJjhNcOCrFx8LET3T1SQAVFYFYGYkrED2E5BiBpF48XJAWiN02RgyJY80JIeQDE2WTh04784OqnZRwQG3DkmmVfQNLjNxFAFeRWms~942r2qxIpQ-5tZojMVlNO9molhbGwnCwydXN4957r1s2EJ5LsRlHnxHySBB4nRZzAUCUFrPwrQBqFf0ZCkU-P0y-J80vcGTaCCI6TKmwvGZyeatEoPezqqiSFLwKgeF42z05Y-9kO5jbkOqHfgfAkBbohNn5pdNIfSHy44PuwFqex4XZlDnRofdqSZXZigKQ__\u0026Key-Pair-Id=APKAI5CNWVPOYRVLGC6Q",
by
So the command should be something like this :
JREPL "
"image":"" "" /f myfile.json /o -
and
JREPL "
?Expires[all_chars_until_the last_",]"," "" /f myfile.json /o -
Same for this line, I need a cleanup like this :
"description":"\r\n{center: begin}{size : 30}{outline : #000000 , 2}\"{shadow: #FFCC00, 3, 4, 5}{color : #4B76F2}Check 1-2\r\nNews\" \r\navailable !{size}{outline}{shadow}{color}{center}\r\n\r\nJREPL ROCKS !\r\n\r\n"}
by
Code: Select all
<span style="color: #ff9900;"><strong>Check 1-2 News available !<br> JREPL ROCKS ! <br></strong></span>
So the command should be something like this :
JREPL "
"description"[all_chars_until_the last_}_of_{color : #4B76F2}]" "" /f myfile.json /o -
and
JREPL "
\r\n\r\n" "<br>" /f myfile.json /o -
and
JREPL "
\r\n" "" /f myfile.json /o -
and
JREPL "
{size}{outline}{shadow}{color}{center}" "" /f myfile.json /o -
Of course none of these cmds works, certainly because I don"t use the correct syntax.
My first question will be, is-it possible to do such things with this script ?!
Thanks by advance,
Best regards!