diff --git a/benchmarks/input/create_hex_data_file.sh b/benchmarks/input/create_hex_data_file.sh index a213d65..d7beb46 100755 --- a/benchmarks/input/create_hex_data_file.sh +++ b/benchmarks/input/create_hex_data_file.sh @@ -13,12 +13,13 @@ inputfile="$1" outputfile="$2" +# 1. gzip output file +# 2. convert to hex +# 3. drop last line of output +# 4. print all but first parameter (offset) in C++ formatting + cat "$inputfile" | \ gzip -9 | \ od -v -t x1 | \ -sed \ -'s/^[0-9A-Fa-f]\{1,\} *// -/^ *$/d -s/ \{1,\}/,0x/g -s/^/0x/ -s/$/,/' > "$outputfile" +awk 'NR>1{print buf}{buf = $0}' | \ +awk '{for (i=2; i<=NF; i++) print "0x"$i","}' > "$outputfile"