|
@@ -0,0 +1,83 @@
|
|
|
+# Adapt an ICS file with Vim
|
|
|
+
|
|
|
+Tips to modify an autogenerated ics file with the Vim text editor.
|
|
|
+
|
|
|
+## Remove useless description
|
|
|
+
|
|
|
+Vim command : `:%s/^ - DESCRIPTION : .*\n//c`
|
|
|
+
|
|
|
+## Remove unescaped \n
|
|
|
+
|
|
|
+Vim command : `:%s/\\n//g`
|
|
|
+
|
|
|
+Before :
|
|
|
+```
|
|
|
+SUMMARY:TP - CCUBE - C000\n
|
|
|
+```
|
|
|
+
|
|
|
+After :
|
|
|
+```
|
|
|
+SUMMARY:TP - CCUBE - C000
|
|
|
+```
|
|
|
+
|
|
|
+## Shrink first dash
|
|
|
+
|
|
|
+Vim command : `:%s/ - \(.*\) \?\(-\?\) \?/,\1\2/g`
|
|
|
+
|
|
|
+Before :
|
|
|
+```
|
|
|
+SUMMARY:TP - CCUBE - C000
|
|
|
+SUMMARY:CM - CCUBE
|
|
|
+```
|
|
|
+
|
|
|
+After :
|
|
|
+```
|
|
|
+SUMMARY:TP,CCUBE - C000
|
|
|
+SUMMARY:CM,CCUBE
|
|
|
+```
|
|
|
+
|
|
|
+## Remove extra location
|
|
|
+
|
|
|
+Vim command : `%s/ - .*$//`
|
|
|
+
|
|
|
+Before :
|
|
|
+```
|
|
|
+SUMMARY:TP,CCUBE - C000
|
|
|
+SUMMARY:CM,CCUBE
|
|
|
+```
|
|
|
+
|
|
|
+After :
|
|
|
+```
|
|
|
+SUMMARY:TP,CCUBE
|
|
|
+SUMMARY:CM,CCUBE
|
|
|
+```
|
|
|
+
|
|
|
+## Remove semester from subjects
|
|
|
+
|
|
|
+Vim command : `:%s/S[3579]\+//`
|
|
|
+
|
|
|
+Before :
|
|
|
+```
|
|
|
+SUMMARY:TD,EPSS79
|
|
|
+SUMMARY:TD,ALLS7
|
|
|
+```
|
|
|
+
|
|
|
+After :
|
|
|
+```
|
|
|
+SUMMARY:TD,EPS
|
|
|
+SUMMARY:TD,ALL
|
|
|
+```
|
|
|
+
|
|
|
+## Swap type of course and subject
|
|
|
+
|
|
|
+Vim command : `%s/SUMMARY:\(.*\),\(.*\)/SUMMARY:\2,\1/c`
|
|
|
+
|
|
|
+Before :
|
|
|
+```
|
|
|
+SUMMARY:TD,EPS
|
|
|
+```
|
|
|
+
|
|
|
+After :
|
|
|
+```
|
|
|
+SUMMARY:EPS,TD
|
|
|
+```
|