Mercurial > getan
annotate scripts/convert-projects @ 550:28b1c18c900f
Specify project keys in getan-report with SQL patterns
* In getan-report project keys can now be specified with SQL patterns.
This allows projects and their sub-projects to be better selected for output.
% - zero, one, or multiple characters
_ - single character
author | Magnus Schieder <mschieder@intevation.de> |
---|---|
date | Tue, 11 Feb 2020 15:46:37 +0100 |
parents | 20fde79f8e12 |
children |
rev | line source |
---|---|
1
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
1 #!/usr/bin/awk -f |
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
2 |
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
3 # Convert classic worklog projects file to SQL statements for inseration in the getan database. |
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
4 # USAGE: |
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
5 # ./convert-projects </PATH/TO/projects | sqlite3 time.db |
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
6 |
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
7 BEGIN { FS=":"; } |
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
8 |
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
9 /[^# \t]/ { |
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
10 printf "INSERT INTO projects (key, description) VALUES ('%s', '%s');\n", $1, $2; |
a3fe8e4e9184
- To exit getan you now can use double BACKSPACE, too.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
11 } |