Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
10
votes
2
answers
8601
views
Which linux command-line tool can view, search, add contacts to/from a .vcf file?
I've downloaded my contact list in `.vcf` format to my Linux machine. Now I would like to edit it locally (offline). The search feature is most important. I've got a script with grep and so on but I was hoping someone had already done the work to make things beautiful and readable.
I've downloaded my contact list in
.vcf
format to my Linux machine.
Now I would like to edit it locally (offline). The search feature is most important.
I've got a script with grep and so on but I was hoping someone had already done the work to make things beautiful and readable.
philou
(237 rep)
Mar 19, 2020, 10:20 AM
• Last activity: Jan 2, 2025, 12:09 AM
3
votes
1
answers
693
views
How to join vCards lines
vCard uses a special way to split long lines: At 75 characters, insert a DOS newline *and* a space. Joining therefore means to **replace all occurrences of the sequence "CR, LF, space" with an empty string** and otherwise leave the file alone. The simplest way I've found so far (using [`sed` multi-l...
vCard uses a special way to split long lines: At 75 characters, insert a DOS newline *and* a space. Joining therefore means to **replace all occurrences of the sequence "CR, LF, space" with an empty string** and otherwise leave the file alone. The simplest way I've found so far (using
sed
multi-line search and replace ) is this:
sed -n '1h;1!H;${;g;s/\r\n //g;p;}' contacts.vcf
That's rather unreadable. Is there an easier way?
Edit: Resulting implementation based on Peter.O's answer .
l0b0
(53368 rep)
Jun 11, 2012, 07:59 AM
• Last activity: Jun 11, 2022, 09:13 AM
1
votes
2
answers
785
views
How to split vCards lines
Related to [How to join vCards lines][1], vCard does a weird kind of line splitting: **If a line contains more than 75 characters, insert a "CR, LF, space" sequence.** Thus the following line: 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J1234567...
Related to How to join vCards lines , vCard does a weird kind of line splitting: **If a line contains more than 75 characters, insert a "CR, LF, space" sequence.** Thus the following line:
123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789S123456789U123456789V123456789W123
should be split into the following lines:
123456789A123456789B123456789C123456789D123456789E123456789F123456789G12345
6789H123456789I123456789J123456789K123456789L123456789M123456789N123456789
O123456789P123456789Q123456789R123456789S123456789U123456789V123456789W123
You can't just insert the line split sequence every 75 characters, because then there would be more than 75 characters per line again, and you can't just insert after counting 75 characters because it should only be inserted if the line is *longer* than 75 characters. One way to do it is to repeat the following command until the input no longer changes:
sed -e 's/^\(.\{75\}\)\([^\r]\)/\1\r\n \2/' < file | sed -e '...' | ...
That's obviously not going to work with indeterminately long lines, and is horribly inefficient. How would you do this sort of replacement?
l0b0
(53368 rep)
Jun 11, 2012, 09:11 AM
• Last activity: May 10, 2022, 12:15 PM
1
votes
0
answers
231
views
How to display thumbnails for contact / vcf / vcard files in Nautilus or another file browser in Ubuntu 14.04?
Does anyone know of a way to display thumbnails for contact / vcf / vcard files in Nautilus or another file browser in Ubuntu 14.04?[![enter image description here][1]][1] [1]: https://i.sstatic.net/nNDuS.png We were trying to put this together but were unsuccessful but received dozens of "I want th...
Does anyone know of a way to display thumbnails for contact / vcf / vcard files in Nautilus or another file browser in Ubuntu 14.04?
We were trying to put this together but were unsuccessful but received dozens of "I want this too" comments from other users and friends.
What would be a simple way to show a thumbnail for all the vcf / vcard files showing the photo and the contact information for each contact?

Lili Gates
(11 rep)
Apr 1, 2017, 01:24 AM
• Last activity: Apr 1, 2017, 11:22 AM
Showing page 1 of 4 total questions