summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/makecolumns.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/makecolumns.sh b/src/makecolumns.sh
index 1d4c399..9e8d6cb 100755
--- a/src/makecolumns.sh
+++ b/src/makecolumns.sh
@@ -197,7 +197,7 @@ handle_new_format() {
197 printf "done.\n" 197 printf "done.\n"
198 198
199 printf "Extracting phonebook.db ... " 199 printf "Extracting phonebook.db ... "
200 decompress $1/phonebook.db | grep -v appropriate 200 decompress $1/phonebook.db
201 201
202 rows=`find . -name file_\* | wc -l` 202 rows=`find . -name file_\* | wc -l`
203 rows=$(( rows / 11 )) 203 rows=$(( rows / 11 ))
@@ -205,11 +205,11 @@ handle_new_format() {
205 205
206 # Do enumerations with builtin shell tools. Unfortunally neither 206 # Do enumerations with builtin shell tools. Unfortunally neither
207 # jot nor seq are standards 207 # jot nor seq are standards
208 printf "Splitting decompressed chunks into their columns (11 total) ... 0, " 208 printf "Splitting decompressed chunks into their columns (11 total) ... 1, "
209 f=0; while [ $f -lt $rows ]; do printf "file_%05X " $(( f++ * 11)); done | xargs cat | xxd -ps -c1 > column_0 209 f=0; while [ $f -lt $rows ]; do printf "file_%05X " $(( f++ * 11)); done | xargs cat | xxd -ps -c1 > column_0
210 210
211 for column in 1 2 3 4 5 6 7 8 9 10; do 211 for column in 1 2 3 4 5 6 7 8 9 10; do
212 printf "%d, " $column 212 printf "%d, " $(( column + 1 ))
213 f=0; while [ $f -lt $rows ]; do printf "file_%05X " $(( column + f++ * 11 )); done | xargs cat | tr '\n\0' '\t\n' > column_${column} 213 f=0; while [ $f -lt $rows ]; do printf "file_%05X " $(( column + f++ * 11 )); done | xargs cat | tr '\n\0' '\t\n' > column_${column}
214 done 214 done
215 printf "done.\n" 215 printf "done.\n"