Startseite | Themenabende | Mailingliste | Pläne | Links | GnuPG-Schlüssel
Achtung: Dieser Quelltext darf nur betrachtet werden, die Ausführung würde das Patent EP1283486 verletzen.
#!/bin/sh

# Parameters: input-file number-of-columns [C|R]
#             (C: concat columns; R: concat rows)

N=$2

# Preparation
cat << EOF | mysql
  use test
  drop table if exists t;
  create table t (`seq -f "c%g text," $N` dummy int);
  load data local infile '$1' into table t fields terminated by ' ';
EOF

# Format multiple columns (claim 11) by ...
# ... concatenating rows (claim 12)
if [ "$3" = R ]; then
  echo "use test; update t set c1=concat(`seq -f "c%g,'\n'," $N` '')" | mysql
  N=1
fi
# ... or columns (claim 13)
if [ "$3" = C ]; then
  echo "use test; update t set c1=concat(`seq -f "c%g," $N` '')" | mysql
  N=1
fi

# Format each column into a file (claim 1)
for n in `seq $N`; do

  cat << EOF | mysql > col$n

    use test

    # Count occurrences and derive a code from them (claim 6) and the position
    # (claim 5), store that in a table (claim 7)
    create temporary table occ (n int auto_increment primary key)
      select count(*) as c, c$n from t group by c$n;

    # Create an encoding table (claim 10)
    create temporary table enc select n, c, (n+c)*(n+c)+n as e from occ;

    # Store entries (claim 8) as a file header (claim 9)
    select c$n from occ;

    # Output dictionary entries (claim 53) in the header (claim 54)
    select e, occ.c, c$n from occ left join enc using (n, c);

    # Write values, replaced by the code (claim 4) to compress them (claim 3)
    select e from t left join occ using (c$n) left join enc using (n, c);
EOF
done
Startseite | Themenabende | Mailingliste | Pläne | Links | GnuPG-Schlüssel
Letzte Änderung: 31. Mai 2003
Benedikt Wildenhain, patente@benedikt-wildenhain.de