From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31480 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Martin Hepp Newsgroups: gmane.text.pandoc Subject: Re: Formatted PDF from CSV data Date: Thu, 29 Sep 2022 18:53:23 +0200 Message-ID: <51C50E26-9499-4EDB-8E59-82877AB3B2CF@gmail.com> References: <7db8040f-dd62-416f-a3d7-a88c1e257d9en@googlegroups.com> <0df46ea0-a6a6-4abc-a6df-2e48fe895fb2n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34714"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss via Original-X-From: pandoc-discuss+bncBDDMFSFCYUDBBBU326MQMGQEI3J6ZVY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Sep 29 18:53:30 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wr1-f64.google.com ([209.85.221.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1odwmv-0008tL-UO for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 29 Sep 2022 18:53:29 +0200 Original-Received: by mail-wr1-f64.google.com with SMTP id u20-20020adfc654000000b0022cc05e9119sf739086wrg.16 for ; Thu, 29 Sep 2022 09:53:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664470409; cv=pass; d=google.com; s=arc-20160816; b=mHOeJYAhP1qQmcMVZAK/CGmQJVAPPjbdg9lHYRFu8ClefgP9oPT4YLoHrB9BYhBDrN NNzT3eV3Al4sTn8AHxifCeL0i/0pzNmcA8bEDlFMwoZEKJCDd9Qb6JY70afRcAWQSGS/ Uh24WKQZkJcBeNz/Oss3g/Ca4E5KFOdNY9HrRjIs0YsmpkN33g5GVumikp1mvCRZjarE CSF5/BHhhS5QGf0LL4SlVkNzFLq9QlWs5VAPTy9iZXsvjnfA6Smc88Va8LPh+jCBKBUj fGK7UGl3x5ZuR+BZ75NCHrrqJ7soStqTrw8OPdgnzR90s9SWqMjN3Rt/Hewv+c6Tu5eU DXsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:message-id:in-reply-to:to :references:date:subject:mime-version:content-transfer-encoding:from :sender:dkim-signature:dkim-signature; bh=UcLe7XeXrLjI9mIOeZ0nRuY5+P+46vs73UKzzKxg7e8=; b=CBy1Tx0+QNe/6GsoT8Riv7vEjHbD89J9Y/fwaPVGzZn2lNdXFIrpUnl2GT36xCd3MX 2B32OXtbLyXj8dxQNi+3O1iguj8VoprcP5X5p0rNEr+etGZfFNfQsIpmuFDpUvsp0yG6 IFDT6/kCAL1MMRzpbnH8zsf9rbq0kZWpg0V85c9E1isHzr/Yifr9IqsdAFS6SaUuj8Bs u9ycl1UM9eGbwhm7ibTXfXMarPCXbS9T45JWMR+FRbnSeAERnXDKzOvPeL1CjnvXVvHM 8FoKWGszE6lYy3HTRztNLNyeLHpA1THxH3uhlLuoJF64FLHeqvGkA1EjNSlWd+xzC+/a 4v7w== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gSLb4lbp; spf=pass (google.com: domain of mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::62c as permitted sender) smtp.mailfrom=mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:sender:from:to:cc:subject:date; bh=UcLe7XeXrLjI9mIOeZ0nRuY5+P+46vs73UKzzKxg7e8=; b=dXQjDwxvovFJRxFdjVX/dNnXAC0igTx27bIcZa3j4E9DvDgc79M5F8CzK7pJMn68E9 JiP9n+edbdLsShDEOgEwxotBAnQM/s75FXzk6ELOhjISbtSjGPCqEd/TUjOa+iK5LhYT g0DPNP8RoXu2dnz2eZk+qcIDNChqY7q0p1siKjuHwDhstIufeX6iIepjmMDoXmY+LfYz p7JfLANEDk+ucjK7zgWh2YjQhQ7lw7eHxV/JFrAWmsquOIfKa/TreZxI5iIuIhu7oBky ZkXEpnHlUqhKkWgIpYbYk5IxR2xU8ECqzJWEiHs03m9ngrWlJzPAF1hXrNMMaHq31kAq NtmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date; bh=UcLe7XeXrLjI9mIOeZ0nRuY5+P+46vs73UKzzKxg7e8=; b=GWl8C/QNN6vOo/+MAVFZ7uJmrLBeylFDMBkZ4Yr8c0wejNdtOOlMSU09jgWOqnJsbC R/NnfXFOy9kF0VRjqSAk1HI62CqKZojv0xYswQf5XtMqdDuEkPH8U986QmzFQpC6gXhb cxR+BFtnOK1WlMYF+LMcO0+kyfxscslvWBzxZ3VGEX7vTnIwyRDQsR05+jBOQcZnQivt ETeaPg1NFQ8t5UFQHmT2LQVTLz9xyFIyXjsaAzRkjj8/DXtcpdeV7VKvaiRK5C/qcIKq U+3YlMlq17iKVql1JgTKHQH0t3AV+mhVUpx8O+PZh+vto4NOveuRy6ZePKpW8qO1uCN6 TsuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:sender:from:to:cc :subject:date; bh=UcLe7XeXrLjI9mIOeZ0nRuY5+P+46vs73UKzzKxg7e8=; b=Yx/8JRrwlHenmVeGW9y52n9Duuk26kMHFSF+i2ILesm/NJc69V51ZPCjFeGsRoEWn1 WEtA67dGvptdJtETs4+pw06BdRZ+0h+LHl7c9Q26tfSGJ7mssimIrAuH3AOz/X0wxfRd BmtRf9shj75T/QRCaAi8nLfwvThkKE8jlC0xCcMd6U2mtZ0FKGvZVW/B+6DXVpU7Jcat vCtsonHMdaS8Yrc74CVavdHOm4NMfFJrfdWaKshRbPuJ8XHzfeaJ0+TowoI0Ofcee4i3 IKpuq4U0vxX3O9qYD817fmNuvDZO3Yt8xZJso+dB Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACrzQf07VWkhaOB5NKlN1n9j4n3LwI+r3/UdgwmzfUYKHaSvJvTejboN yxID+uQqYsz9BbhnaXCp+cQ= X-Google-Smtp-Source: AMsMyM7TlqiRQHmcsvpdDsDCklDx8GTdI6A9oiHLwzuxWTqMY51V4KsiwvQiycnCxd6FlxtkKJFfgQ== X-Received: by 2002:a05:600c:1906:b0:3b4:c979:e686 with SMTP id j6-20020a05600c190600b003b4c979e686mr3236081wmq.107.1664470409264; Thu, 29 Sep 2022 09:53:29 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a1c:7714:0:b0:3b4:a307:9032 with SMTP id t20-20020a1c7714000000b003b4a3079032ls1205762wmi.2.-pod-control-gmail; Thu, 29 Sep 2022 09:53:25 -0700 (PDT) X-Received: by 2002:a05:600c:3cd:b0:3b4:8372:294c with SMTP id z13-20020a05600c03cd00b003b48372294cmr11563441wmd.191.1664470405392; Thu, 29 Sep 2022 09:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664470405; cv=none; d=google.com; s=arc-20160816; b=Ap7bL0GXKsCZgCUzDNLVLxkhSFJkdPzvB6RHRZWEBwnJ8WveGrDWhZrGuaIOceVZt/ 4e1Ld+mH2XbX2kH55K6jmC8PCrSDi/skPZ1H4DPSZXPOaxanGQJCozLxDvbz5v7MyqI/ DVWBwtIO4cmQ/DE0PESQVLJ2PCQJ80lcNom+4Uj0AzsEx67vgCzBzWXJ6/QGWc/ipkoY FOryQkTb4fvIFzesbTGL3b+Z6rOgEMINTw0qQFbloN18c/tMUXd7Vi00Tw2ooE/j7+da F+Rk/ylmIwOZVHx8HiBBvVc6UMCwzJTqv/+dhzdFIZzmQtdLLAd5lz1piXRs1Su+hKAa zXTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:dkim-signature; bh=FzoG492l8foopENQ406Gn1NEyEZObeHemwt/cpOpmgs=; b=s9RcKHDoJYPpJ3uhyBNQ89zw62Zr240JEhTSnNpqqj2xzvKKF97AJJsYAZdpezIRpp 6HiPVlBDKNRzBJPmVB4u501KVoX08YaZMuySJEtdoOMr5SKnrP+WtDRpWPqpsUQp4+nd y7cdL/orCJyrKyzmRy5HtFPKtOxmjqH8sHptcanKX+hddxzCbpP4XIqfUCvtvoL9HlOo CkO8jypVT2FVtJw4nJwbSjOmSHvaCCWv4h1Sl2yGTMkvuBXnU3fxcfNKaBOP66OX6oWK bYsS0OEfYqv6bU7x6eabZk5/Z+IaIYdZuC9q6cITB20r9b8fbZJuLDTmrLVbNzMApZH2 rg1w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gSLb4lbp; spf=pass (google.com: domain of mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::62c as permitted sender) smtp.mailfrom=mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com. [2a00:1450:4864:20::62c]) by gmr-mx.google.com with ESMTPS id 125-20020a1c1983000000b003a6787eaf57si365255wmz.2.2022.09.29.09.53.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Sep 2022 09:53:25 -0700 (PDT) Received-SPF: pass (google.com: domain of mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::62c as permitted sender) client-ip=2a00:1450:4864:20::62c; Original-Received: by mail-ej1-x62c.google.com with SMTP id a26so4038616ejc.4 for ; Thu, 29 Sep 2022 09:53:25 -0700 (PDT) X-Received: by 2002:a17:906:dc95:b0:783:4e1:d5c4 with SMTP id cs21-20020a170906dc9500b0078304e1d5c4mr3371600ejc.463.1664470405101; Thu, 29 Sep 2022 09:53:25 -0700 (PDT) Original-Received: from smtpclient.apple (dynamic-095-118-001-233.95.118.pool.telefonica.de. [95.118.1.233]) by smtp.gmail.com with ESMTPSA id e19-20020a170906081300b0073cdeedf56fsm4166727ejd.57.2022.09.29.09.53.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Sep 2022 09:53:24 -0700 (PDT) In-Reply-To: <0df46ea0-a6a6-4abc-a6df-2e48fe895fb2n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Original-Sender: mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gSLb4lbp; spf=pass (google.com: domain of mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::62c as permitted sender) smtp.mailfrom=mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:31480 Archived-At: As my last post might have been too brief to be actually helpful, here is a= complete example: 1. Python Script =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # csv2md.py # Run with # python csv2md.py > markdown_file.md import csv # Read from file and return dict with keys from first line in CSV with open('data/performance_review.csv', newline=3D'') as csvfile: reader =3D csv.DictReader(csvfile) # Convert to a list so that we can access it multiple times reader =3D list(reader) print("# Employee Assessment Report") print() print("This report contains assessments for the following staff members:") print() for row in reader: print(f"- {row.get('name', '[Name missing]')}") print() for row in reader: print(f"# Employee: {row.get('name', '[Name missing]')}") print() print(f"## Job Position: {row.get('position', 'N/A')}") print() =20 print(f"{row.get('job_description', 'No detailed description available.= ')}") print() =20 print(f"## Assessment") print() =20 print(f"**Overall Performance:** {row.get('rating', 'N/A')} of 5") print() =20 print(f"{row.get('review', 'No detailed review available.')}") 2. Example File data/performance_review.csv =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D name, position, job_description, rating, review Joe Miller, Developer, "Python back-end", 4, "Hard-working and diligent" Paula Mayer, CIO, "Overall IT responsibility", 4, "Effective and motivating= " 3. Output markdown_file.md =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D # Employee Assessment Report This report contains assessments for the following staff members: - Joe Miller - Paula Mayer # Employee: Joe Miller ## Job Position: N/A No detailed description available. ## Assessment **Overall Performance:** N/A of 5 No detailed review available. # Employee: Paula Mayer ## Job Position: N/A No detailed description available. ## Assessment **Overall Performance:** N/A of 5 No detailed review available. 4. Rendering =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D You can then use any Pandoc workflow you like to convert that into PDF, MS = Word, etc. If the data is a bit more complex, I would parse into a Pandas DataFrame an= d process the data in there, like so df =3D pd.read_csv('data/performance_review.csv') Hope that helps! Best wishes Martin Resources: =3D=3D=3D=3D=3D=3D=3D=3D=3D - https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html - https://docs.python.org/3/library/csv.html ----------------------------------- martin hepp https://www.heppnetz.de mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > On 28. Sep 2022, at 12:38, Thomas Chevrier wrote: >=20 > https://stackoverflow.com/questions/71224773/dynamically-set-r-markdown-t= itle-output-filename-and-global-variables=20 >=20 > could this be of any help to what you are trying to achieve or am I misre= ading your issue? Apologies if so. >=20 > On Wednesday, September 28, 2022 at 6:06:57 AM UTC+9 gianluc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org= wrote: > Hi everyone,=20 >=20 > I try to create a Structured PDF (Title, headers, dates, and other stuff)= starting from a CSV file which contain an header and responses. This CSV w= as generated by a Google Forms Questions and Answer, and starting from that= one I want to create a simple formatted document. >=20 > Anyone have some ideas on which characteristcs of pandoc can I use to obt= ain this results? >=20 > As example, i share with you some screen of the desidered results >=20 > CSV file: >=20 > PDF (output) file >=20 >=20 > Thank you so much for your help! >=20 > --=20 > You received this message because you are subscribed to the Google Groups= "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgi= d/pandoc-discuss/0df46ea0-a6a6-4abc-a6df-2e48fe895fb2n%40googlegroups.com. --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/51C50E26-9499-4EDB-8E59-82877AB3B2CF%40gmail.com.