File: atomscsv2atomspml.bash

package info (click to toggle)
camitk 6.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 389,508 kB
  • sloc: cpp: 103,476; sh: 2,448; python: 1,618; xml: 984; makefile: 128; perl: 84; sed: 20
file content (15 lines) | stat: -rwxr-xr-x 425 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# Transform a csv into an atoms SC
# usage:
# atomscsv2atomspml.bash file.csv
in=$1
out=${1/.csv/-atoms.pml}

echo output: $out

echo "<atoms>" > $out
echo "<structuralComponent  mode=\"WIREFRAME_AND_SURFACE\" >" >> $out
sed "s/^\(.*\) \(.*\) \(.*\) \(.*\)/<atom>\n<atomProperties index=\"\1\" x=\"\2\" y=\"\3\" z=\"\4\"  \/>\n<\/atom>/" $1 >> $out
echo "</structuralComponent>" >> $out
echo "</atoms>"  >> $out