#!/bin/bash file_in="/media/cerba/Data/Data/SPOI/SPOI_In/Italy.csv" file_out="/media/cerba/Data/Data/SPOI/RDF_output/Hyperborea_S4a.rdf" echo '' > $file_out echo '' >> $file_out i=1 while IFS=$';' read -r -a A do test $i -eq 1 && ((i=i+1)) && continue if [ "${A[3]}" = "alimentari" ] || [ "${A[3]}" = "appartamenti vacanze" ] || [ "${A[3]}" = "appartamentovacanze" ] || [ "${A[3]}" = "bar" ] || [ "${A[3]}" = "Bar" ] || [ "${A[3]}" = "biblioteca" ] || [ "${A[3]}" = "Biblioteca" ] || [ "${A[3]}" = "hotel" ] || [ "${A[3]}" = "museo" ] || [ "${A[3]}" = "Museo" ]; then echo '' >> $file_out echo ''${A[7]}'' >> $file_out echo ''${A[0]}'' >> $file_out if [ "${A[3]}" = "alimentari" ]; then echo '' >> $file_out fi if [ "${A[3]}" = "appartamenti vacanze" ] || [ "${A[3]}" = "appartamentovacanze" ]; then echo '' >> $file_out echo '' >> $file_out fi if [ "${A[3]}" = "bar" ] || [ "${A[3]}" = "Bar" ]; then echo '' >> $file_out echo '' >> $file_out fi if [ "${A[3]}" = "biblioteca" ] || [ "${A[3]}" = "Biblioteca" ]; then echo '' >> $file_out echo '' >> $file_out fi if [ "${A[3]}" = "hotel" ]; then echo '' >> $file_out echo '' >> $file_out fi if [ "${A[3]}" = "museo" ] || [ "${A[3]}" = "museum" ]; then echo '' >> $file_out echo '' >> $file_out fi if [ -n "${A[8]}" ]; then echo ''${A[8]}'' >> $file_out; fi if [ -n "${A[2]}" ]; then echo ''${A[2]}'' >> $file_out; fi if [ -n "${A[4]}" ]; then echo ''${A[4]}'' >> $file_out; fi if [ -n "${A[5]}" ]; then echo ''${A[5]}'' >> $file_out; fi if [ -n "${A[6]}" ]; then echo ''${A[6]}'' >> $file_out; fi echo '' >> $file_out echo 'SPOI (http://sdi4apps.eu/spoi)' >> $file_out echo ''${A[7]}'' >> $file_out echo '' >> $file_out echo '' >> $file_out echo ''$(date +%Y-%m-%d)'' >> $file_out echo '' >> $file_out fi done < $file_in echo '' >> $file_out