0

I have contacts in single vcf file as

BEGIN:VCARD
VERSION:3.0
FN:XYZ
N:XYZ;;;;
TEL;TYPE=CELL:0123456789
END:VCARD

I used vcard splitter to split them into vcf files with single contact so that I can add them on my s60 nokia phone. Since the FN and N values are same for many contacts, the name is repeated twice on the contact list. So I want to write a regular expression for removing FN: values for each VCARD. Can someone give me the regular expression for that.

fz8975
  • 45
  • 1
  • 8

2 Answers2

0

You could use Notepad++ for this task:

  1. Goto the search menu Ctrl+F and there to the "Mark" tab. Check "Bookmark line".

  2. Check the regular expression option

  3. Then just enter ^FN: as search term and click "Mark All"

    ==> All lines containing the search term are bookmarked.

    ^ Is an anchor that matches the start of the row.

  4. Now go to the Menu "Search - Bookmark - Remove Bookmarked lines"

    ==> All marked lines are gone.

stema
  • 90,351
  • 20
  • 107
  • 135
  • Thanks stema, but the splitter is showing problems without FN: entry so what should I do to have FN: values as NULL – fz8975 Feb 19 '13 at 17:27
  • I have no idea, try maybe replacing `^FN:.*` with "FN:" – stema Feb 19 '13 at 17:29
  • yeah it worked but it N: value was to set to NULL not FN: Thank You very much, BTW i checked your blog very helpful – fz8975 Feb 19 '13 at 17:44
0

What stema says, or if you like the cool tools:

sed -i "s/^FN:.*\n$//" *.vcf
Nodebody
  • 1,433
  • 11
  • 14