After trying a couple of scripts on internet (php & nodejs) I decided to create my own small script, which takes the contact name from the file name, the search for phone number with a simple regex.
<?php
$files = scandir( './contacts' );
$fp = fopen( "./contacts.csv", 'w' );
foreach ($files as $contact) {
if( !preg_match( "/\.vcf$/i", $contact ) ) continue;
$name = str_replace( ".vcf", "", $contact );
if( empty( $name ) ) continue;
$content = file_get_contents( "./contacts/$contact" );
preg_match_all( "/\+?\d+/i", $content, $m);
$row = array($name, end( $m[0] ) );
fputcsv($fp, $row);
}
fclose($fp);
echo "Done";
This script is very limited, but I wanted to share it since it can easily adapted for other usages.
I hope it helps somebody some day.