Skip to content

Instantly share code, notes, and snippets.

@wuftymerguftyguff
Last active July 15, 2016 09:31
Show Gist options
  • Save wuftymerguftyguff/ebb1f57fec5eec0eab7e8d24492db4be to your computer and use it in GitHub Desktop.
Save wuftymerguftyguff/ebb1f57fec5eec0eab7e8d24492db4be to your computer and use it in GitHub Desktop.
Script to generate a template orderby.txt when tablesplitting is used for a SAP R3load export
#!/usr/bin/sh
SID=$1
cd /migration/$SID/export/DUMP/ABAP/DATA
list=$(ls -la *.WHR | awk -F ' ' '{print $9}' | sed -e 's/\.WHR//g')
prev_table=""
for l in $list
do
table=$(echo $l | sed -e "s/-.*//g")
tableu=$(echo $table | tr '[a-z]' '[A-Z]')
if (test "$prev_table" != "$table") then
echo
echo "[""$tableu""]"
tablepost="$tableu""-"
num_splits=$(ls -la *.WHR | grep "$tablepost" | wc -l | sed -e 's/ //g')
echo "jobNum=$num_splits"
fi
echo $l
prev_table=$table
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment