ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Creating business cards with CSV
@ 2019-02-07 13:27 Jan U. Hasecke
  2019-02-08 18:54 ` Pablo Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Jan U. Hasecke @ 2019-02-07 13:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I found some hints to CSV in the wiki, but they all refer to tables.

What are the building block to create business cards from a csv file?


My business-card.tex looks like this:

\starttext

{\bf Vorname Name}\\
Function

\blank

Company\\
Street\\
PLZ City\\
Germany\\
Telefon: 12345678\\
name@example.com\\
www.example.com\\

\stoptext

In pseudo code I think something like this could work:

for i in csv:
    {\bf $Vorname $Name}\\
    $Function

    \blank

    $Company\\
    $Street\\
    etc.
    \page

The variables ($Vorname, $Name etc) could be named according to the
columns in the first row in the csv-file.

Each row starting from the second is creating a page (business card).

TIA
juh


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Creating business cards with CSV
  2019-02-07 13:27 Creating business cards with CSV Jan U. Hasecke
@ 2019-02-08 18:54 ` Pablo Rodriguez
  2019-02-10 10:01   ` Jan U. Hasecke
  0 siblings, 1 reply; 4+ messages in thread
From: Pablo Rodriguez @ 2019-02-08 18:54 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

On 2/7/19 2:27 PM, Jan U. Hasecke wrote:
> Hi all,
> 
> I found some hints to CSV in the wiki, but they all refer to tables.
> 
> What are the building block to create business cards from a csv file?
Hi Jan Ulrich,

there is a module that does it (handlecsv, which comes with the ConTeXt
Suite [I wrote the documentation for it]):

I attach both the ConTeXt source and a sample CSV file. It could be a
good starting point.

Just in case it helps,

Pablo
-- 
http://www.ousia.tk

[-- Attachment #2: bscard.tex --]
[-- Type: text/x-tex, Size: 320 bytes --]

\usemodule[handlecsv]
\setheader
\opencsvfile{bscard.csv}

\starttext
\startbuffer[bscard]
\startTEXpage[offset=3em]
{\bf \Vorname\ \Name}\\
\Function

\blank

\Company\\
\Street\\
\PLZ-\City\\
\Country\\
Telefon: \TelNo\\
\eMail\\
\URLAddress
\stopTEXpage
\stopbuffer
\doloopif{\cA}{~=}{}{\getbuffer[bscard]}
\stoptext

[-- Attachment #3: bscard.csv --]
[-- Type: text/csv, Size: 341 bytes --]

"Vorname";"Name";"Function";"Company";"Street";"PLZ";"City";"Country";"TelNo";"eMail";"URLAddress"
"Mustermann";"Jan";"Assistant";"Boring";"25 Street";123;"Moscow";"Russian Federation";2323323;"jmm@boring.com";"boring.com"
"Musterfrau";"Erika";"CEO";"Awesome";"993 Square Root";212;"Berlin";"Germany";8382939;"emf@awesome.com";"awesome.com"

[-- Attachment #4: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Creating business cards with CSV
  2019-02-08 18:54 ` Pablo Rodriguez
@ 2019-02-10 10:01   ` Jan U. Hasecke
  2019-02-11 19:13     ` Pablo Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Jan U. Hasecke @ 2019-02-10 10:01 UTC (permalink / raw)
  To: ntg-context

Thanks Pablo,

great documentation and just the tool I was looking for.

juh
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Creating business cards with CSV
  2019-02-10 10:01   ` Jan U. Hasecke
@ 2019-02-11 19:13     ` Pablo Rodriguez
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Rodriguez @ 2019-02-11 19:13 UTC (permalink / raw)
  To: ntg-context

On 2/10/19 11:01 AM, Jan U. Hasecke wrote:
> Thanks Pablo,
> 
> great documentation and just the tool I was looking for.

Jan Ulrich,

Jaroslav Hajtmar has done a great job with the handlecsv module.

I have used it and I find it extremely useful. The least I could do was
to write the documentation.

Cheers,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-11 19:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07 13:27 Creating business cards with CSV Jan U. Hasecke
2019-02-08 18:54 ` Pablo Rodriguez
2019-02-10 10:01   ` Jan U. Hasecke
2019-02-11 19:13     ` Pablo Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).