I just googled and found vcal, a perl script for displaying vcal files. According to the man page it should do exactly what you need.
There is also gcalcli a command line interface for google calendar which allows you to manage your google calendar. This may allow you to add events you received directly to your existing calendar.
Edited: added install and demo
You need to take care of at least some edge cases, like
- repeated words at the end (and beginning) of the line.
- search should be case insensitive, because of frequent errors like
The the apple
.
- probably you want to restrict search only to word constituent to not match something like
( ( a + b) + c )
(repeated opening parentheses.
- only full words should match to eliminate
the thesis
- When it comes to human language Unicode characters inside words should properly interpreted
All in all I recommend pcregrep
solution:
pcregrep -Min --color=auto '\b([^[:space:]]+)[[:space:]]+\1\b' file
Obviously color and line number (n
option) is optional, but usually nice to have.
Install
On Debian-based distributions you can install via:
$ sudo apt-get install pcregrep
Example
Run the command on jefferson_typo.txt
to see:
$ pcregrep -Min --color=auto '\b([^[:space:]]+)[[:space:]]+\1\b' jefferson_typo.txt
1:He has has refused his Assent to Laws, the most wholesome and necessary
3:He has forbidden his Governors to pass Laws of immediate and
and pressing importance, unless suspended in their operation till his
5:Assent should be be obtained; and when so suspended, he has utterly
The above is just a text capture, but on a color-supported terminal, matches are colorized:
Best Answer
The input format requires character-backspace-underscore or character-backspace-letter to underline a character. You also get boldface with character-backspace-character.
Less does a similar transformation automatically.