I have a script that converts me some files, I create the folders if they do not exist and move them to a desired path.
echo "estacion: "$st;
fcha=$year2"-"$month"-"$day;
echo "fecha: "$fcha;
echo $archivoF " ==> " $rutabase"datos/obs/"$st"/"$year2"/"$archivoF;
if [ ! -d $rutabase"datos/obs/"$st"/"$year2 ]; then
mkdir -p $rutabase"datos/obs/"$st"/"$year2;
fi
mv $archivoF $rutabase"datos/obs/"$st"/"$year2
IFS='.' read -ra tipoO <<< "$archivoF"
tipoOb='echo "."${tipoO[1]}"."${tipoO[2]}'
echo $archivoG " ==> "$rutabase"rinex/nav/"$st"/"$year2"/"$archivoG;
if [ ! -d $rutabase"datos/nav/"$st"/"$year2 ]; then
mkdir -p $rutabase"datos/nav/"$st"/"$year2;
fi
mv $archivoG $rutabase"datos/nav/"$st"/"$year2
IFS='.' read -ra tipoN <<< "$archivoG"
tipoNa='echo "."${tipoN[1]}'
How I can do to insert data into my database from converted files.
The table I have has the following fields:
- name VARCHAR (5) < - $ fileF, $ fileG
- type VARCHAR (5) < - $ typeOb, $ typeNa
- date DATE
- Station VARCHAR (5) < - $ st