aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/scripts/add_vertex_label.sh
blob: f026bd0618766786e324bbfd3b767697846aafc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash 
 
filename=$1; 
 
if [ -z "${filename}" ]; then 
  echo "Please provide a graphson file"; 
  exit 1; 
fi; 
 
if [ ! -f "${filename}" ]; then 
  echo "Unable to find the graphson file ${filename}"; 
  exit 1; 
fi; 
 
sed 's/"label":"vertex"\(.*\)"aai-node-type":\[{"id":"\([^"]*\)","value":"\([^"]*\)"/"label":"\3"\1"aai-node-type":[{"id":"\2","value":"\3"/g' ${filename} > "with_label_${filename}";