I've been trying for over an hour to concatenate a load of .vcf files for import into another device.
I need to have a carriage return and line feed between each vcf so I created a spacerfile which contained just those two characters.
I then generated a list of all the files with the ls command. I then used that file like this :- while read file ; do cat $file spacerfile.txt >> all_in_one.vcf ; done <listfile.txt
But all I get is a load of blank lines with just one or two vcards inserted and then a long list of the vcf files which is most of the listfile.txt.
I am also seeing this type of error :- cat: First: No such file or directory cat: Name.vcf: No such file or directory
That made me wonder if it was because there are spaces in the file names and hence in the listfile.txt so I amended the text file so that each space was preceded by the escape character. But it still doesn't work.
Where am I going wrong?