I'm extracting each user's data into m4-$u.json file with the below shell script
#!/bin/bash
USERID=ricardo.sanchez
PASSWORD=password
PORT=2728
for u in `cat user-list.txt`;
do echo $u;
curl --user $USERID:$PASSWORD http://198.98.99.12:46567/$PORT/protects/$u | jq '.' > m4-$u.json
done
One for the user's output m4-daniel.json file. From that few lines as follows.
[
{
"depotFile": "//ABND/JJEB/...",
"host": "*",
"isgroup": "",
"line": "16",
"perm": "open",
"user": "5G_USER_GROUP"
},
{
"depotFile": "//LIB/...",
"host": "*",
"isgroup": "",
"line": "19",
"perm": "write",
"user": "6G_USER_GROUP"
},
{
"depotFile": "//AND/RIO/...",
"host": "*",
"isgroup": "",
"line": "20",
"perm": "write",
"user": "AND_USER_GROUP"
},
Now from the json output files, I need covert to get it in excel (or) csv in below format. Additionally $PORT & $U shell variables need to be present in the excel (or) csv file. Any help will be appreciated.
