#!/bin/bash seq 380500000001 380509999999 > numbers.txt sed -i -e 's/38050/+38050/g' numbers.txt split -l 50000 numbers.txt splitted for input in splitted*; do awk '{ printf( "BEGIN:VCARD\nVERSION:2.1\nN:;%s\nFN:%s\nTEL;HOME;VOICE:%s\nREV:20121206T114903Z\nEND:VCARD\n\n" , $1 , $1 , $1 ) }' "$input" > vcard_"$input".vcf done rm splitted* rm numbers.txt