Last active
July 15, 2016 09:31
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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