[OS X TeX] Mail merge from Excel to LaTeX letter class?
maarten.sneep at xs4all.nl
Fri Oct 31 07:08:18 EDT 2008
On 31 okt 2008, at 08:04, Andrei Sobolevskii wrote:
> Dear Mike,
> On 31 Oct 2008, at 05:52, Michael Hanson wrote:
>> I have an existing Excel worksheet with contact information that
>> I'd like to "mail merge" into a set of LaTeX-generated letters.
>> Ideally, I'd like to be able to just push a button in TeXShop and
>> have this work -- maybe a macro or engine? I'm willing to learn
>> some basic coding to facilitate a relatively automated solution
> You might first export your Excel file into CSV format (CSV means
> "comma separated values"; since fields in your file probably contain
> commas, choose some other delimiter, e.g. tab) and then process it
> with some tool. E.g. you could write a shell script or a simple C
> program that scans the CSV file and writes out the LaTeX documents.
I've done something like this using PHP. PHP can easily read CSV
files, and inserting the fields into a template is what PHP was
designed to do. I'll send you the files I used off-list.
More information about the MacOSX-TeX