From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/56315 Path: news.gmane.org!not-for-mail From: Roger Mason Newsgroups: gmane.comp.tex.context Subject: Re: [OT] ASCII text output Date: Tue, 16 Feb 2010 18:50:27 -0330 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1266358858 19849 80.91.229.12 (16 Feb 2010 22:20:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Feb 2010 22:20:58 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Feb 16 23:20:56 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NhVmp-0002LB-2q for gctc-ntg-context-518@m.gmane.org; Tue, 16 Feb 2010 23:20:55 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CDC4EC9CE8; Tue, 16 Feb 2010 23:20:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id mm3LqMyzsjTP; Tue, 16 Feb 2010 23:20:49 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0E954C9C43; Tue, 16 Feb 2010 23:20:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 90BBBC9C43 for ; Tue, 16 Feb 2010 23:20:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Y6qUHh9L1LxM for ; Tue, 16 Feb 2010 23:20:30 +0100 (CET) Original-Received: from fitzgerald.ucs.mun.ca (mx5.mun.ca [134.153.232.57]) by balder.ntg.nl (Postfix) with ESMTP id A6E68C9C3D for ; Tue, 16 Feb 2010 23:20:29 +0100 (CET) Original-Received: from perthite.esd.mun.ca (perthite.esd.mun.ca [134.153.36.125]) by fitzgerald.ucs.mun.ca (8.13.1/8.13.1) with ESMTP id o1GMKS0o027884 for ; Tue, 16 Feb 2010 18:50:28 -0330 Original-Received: from perthite.esd.mun.ca (perthite.esd.mun.ca [134.153.36.125]) by perthite.esd.mun.ca (8.14.0/8.14.0) with ESMTP id o1GMKRj9014566 for ; Tue, 16 Feb 2010 18:50:28 -0330 In-Reply-To: (Aditya Mahajan's message of "Tue, 16 Feb 2010 15:25:26 -0500 (EST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-Scanned-By: MIMEDefang 2.67 on 134.153.232.57 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:56315 Archived-At: Hello Aditya, Aditya Mahajan writes: > On Tue, 16 Feb 2010, Roger Mason wrote: > >> Hello, >> >> I need to convert an exam written in ConTeXt to an ascii text file like >> the following: >> >> >> Before I go to the trouble of creating a parser to read the ConTeXt >> input and write the desired output I'm wondering if this can be done >> with ConTeXt itself. > > Can you show a small example of the corresponding tex source? \def\mcquestionnumber{14} \mcquestionheader A ruby is a gem of corundum coloured by\crlf {$A$}: Rutile\crlf{$B$}: Calcium (Ca)\crlf{$C$}: Chromium (Cr)\crlf{$D$}: Iron (Fe) and Titanium (Ti)\crlf \mcquestionfooter And the desired output is... NewQuestion,MC, Title,Ruby coloured by, QuestionText,A ruby is a gem of corundum coloured by Points,1, Difficulty,1, Image,, Option,0,Rutile,, Option,0,Calcium (Ca),, Option,100,Chromium (Cr),, Option,0,Iron (Fe) and Titanium (Ti),, Hint,,,, Feedback,,,, Maybe a regexp would do, followed by a bit of hand editing, but if there is a way of doing this in ConTeXt that would be very convenient. Thanks, Roger ___________________________________________________________________________________ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________