[Linuxtrent] Re: ottenere txt da ooo

  • From: matteo ruffoni <mattruffoni@xxxxxxxxx>
  • To: linuxtrent@xxxxxxxxxxxxx
  • Date: Mon, 18 Oct 2010 13:04:12 +0200

Il giorno 18 ottobre 2010 11:38, Antonio Galea <antonio.galea@xxxxxxxxx> ha
scritto:

> Il codice di prima non era testato, questo funziona:
>
>
> -------------------------------------------------------------------------------------
> #!/bin/bash
>
> #un file contenente i due dati "alunno;banco" su ogni riga
> dati='elenco.txt'
> #un template LaTex con i marcatori "@ALUNNO@" e "@BANCO@"
> template='compito.tex'
> #contatore - solo per differenziare l'output
> i=0
> #il separatore usato nel file $dati è il punto e virgola
> IFS=";"
> cat $dati | while read alunno banco
> do
>   cat $template | perl -000 -pe"s/\@ALUNNO\@/$alunno/g;
> s/\@BANCO\@/$banco/g" \
>      > compito-$i.tex
>  pdflatex compito-$i.tex
>  i=$(expr $i + 1)
> done
>
> -------------------------------------------------------------------------------------
>
>
Ciao sto provando come dici
ma sarebbe stato troppo bello se avesse funzionato subito.
Ecco cosa ho fatto:

file compito.tex

\documentclass{article}
\begin{document}
\title{Articolo per il PLUTO Journal}
\author{Gabriele Zucchetta}
\date{1 gennaio 2000}
   \maketitle
@ALUNNO@
@BANCO@
\end {document}


file elenco.txt

alunno;banco;
marco;primo;
gianni;secondo;
franco;terzo;


file unione.sh

#!/bin/bash

#un file contenente i due dati "alunno;banco" su ogni riga
dati='elenco.txt'
#un template LaTex con i marcatori "@ALUNNO@" e "@BANCO@"
template='compito.tex'
#contatore - solo per differenziare l'output
i=0
#il separatore usato nel file $dati è il punto e virgola
IFS=";"
cat $dati | while read alunno banco
do
 cat $template | perl -000 -pe"s/\@ALUNNO\@/$alunno/g; s/\@BANCO\@/$banco/g"
\
    > compito-$i.tex
 pdflatex compito-$i.tex
 i=$(expr $i + 1)
done

non producoi il pdf  e il log è:

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
(format=pdflatex 2010.10.11)  18 OCT 2010 12:59
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**compito-0.tex
(./compito-0.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang,
noh
yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech,
slov
ak, danish, dutch, finnish, french, basque, ngerman, german,
german-x-2009-06-1
9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian,
san
skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal,
nyn
orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto,
uppersorbian
, estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish,
po
rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded.
)
*marco;primo;

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

<*> m
     arco;primo;
? gianni;secondo;
Type <return> to proceed, S to scroll future error messages,
R to run without stopping, Q to run quietly,
I to insert something,
1 or ... or 9 to ignore the next 1 to 9 tokens of input,
H for help, X to quit.
? franco;terzo;
Type <return> to proceed, S to scroll future error messages,
R to run without stopping, Q to run quietly,
I to insert something,
1 or ... or 9 to ignore the next 1 to 9 tokens of input,
H for help, X to quit.
?
Missing character: There is no m in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no ; in font nullfont!
Missing character: There is no p in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no i in font nullfont!
Missing character: There is no m in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no ; in font nullfont!

*

Overfull \hbox (20.0pt too wide) detected at line 0
[]
 []

(Please type a command or say `\end')
*
! Emergency stop.
<*>

End of file on the terminal!


Here is how much of TeX's memory you used:
 5 strings out of 493848
 141 string characters out of 1152822
 47808 words of memory out of 3000000
 3381 multiletter control sequences out of 15000+50000
 3640 words of font info for 14 fonts, out of 3000000 for 9000
 714 hyphenation exceptions out of 8191
 5i,0n,4p,30b,14s stack positions out of 5000i,500n,10000p,200000b,50000s
!  ==> Fatal error occurred, no output PDF file produced!

Other related posts: