Sidehistorik
...
Kodeblok |
---|
IFS=$(echo -en "\n\b") x=2686981 for text in `cat created_title.csv` do #Remove illegal chars in title text=$(echo "$text"|sed 's/\"//g') text=$(echo "$text"|sed "s/'/\\\'/g") text=$(echo "$text"|sed "s/\//-/g") text=$(echo "$text"|sed "s/?//g") text=$(echo "$text"|sed "s/@/(at)/g") cdate=$(echo $text | awk -F',' '{ print $1 }' ) title=$(echo $text | awk -F',' '{ print $2 }' ) sql="update CONTENT set title='$title',creationdate='$cdate',lastmoddate='$cdate' where contentid=$x" echo $sql echo "SET NAMES 'utf8';$sql" > /tmp/insert.sql mysql --user=cadmin --password=Krejlo8Zi******* confluence < /tmp/insert.sql rm /tmp/insert.sql x=$(( $x + 1 )) done |