-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathparse.sh
executable file
·25 lines (19 loc) · 983 Bytes
/
parse.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
IFS=$'\n'
if [ ! -f toDo2TrelloParsedOld.t2t ]; then
touch toDo2TrelloParsedOld.t2t
fi
mv toDo2TrelloParsed.t2t toDo2TrelloParsedOld.t2t 2> /dev/null
for line in $(cat toDo2Trello.t2t 2> /dev/null)
do
name="$(echo $line | cut -d " " -f 4) $(echo $line | cut -d " " -f 5)"
task=$(echo $line | cut -d "\"" -f 2)
date=$(echo $line | awk -F"for " '{print $2}' | cut -d ' ' -f 1)
classname=$(echo $line | awk -F"in " '{print $2}' | cut -d ' ' -f 1)
method=$(echo $line | awk -F"in " '{print $2}' | cut -d ' ' -f 2)
echo "$name;$task;$date;$classname;$method" >> toDo2TrelloParsed.t2t
echo $name has to $task \for $date into $classname $method
done
diff -b toDo2TrelloParsed.t2t toDo2TrelloParsedOld.t2t 2> /dev/null | grep '^>' | cut -d '>' -f 2 | sed -e 's/^[[:space:]]*//' > done.t2t
diff -b toDo2TrelloParsed.t2t toDo2TrelloParsedOld.t2t 2> /dev/null | grep '^<' | cut -d '<' -f 2 | sed -e 's/^[[:space:]]*//' > newtasks.t2t
rm toDo2Trello.t2t 2> /dev/null