You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
482 B

#!/bin/bash
echo "" > tmp
while read p; do
INIT=${p:0:2}
if [[ "${p:0:4}" =~ ^[0-9]+$ ]] && [ "${p:0:1}" == "${1:0:1}" ]; then
echo $TMP_ROW >> tmp
TMP_ROW="#${p:0:4} | "$'\n'"${p:4}"
elif [ $INIT == "1." ] || [ $INIT == "2." ] || [ $INIT == "3." ]; then
echo $TMP_ROW >> tmp
TMP_ROW="${p:0:1} | "$'\n'"${p:2}"
else
TMP_ROW="$TMP_ROW $p"
fi
done < $1
echo $TMP_ROW >> tmp
sed -i -e 's/- //g' tmp
#mv tmp ../data/$1