Author Archive

Webseiten parsen mit Python

Hier ein kurzes Beispiel, wie man mittels Python und BeautifulSoup Texte aus Webseiten extrahieren kann.

import urllib2
from BeautifulSoup import BeautifulSoup
 
# http://stackoverflow.com/questions/1752662/beautifulsoup-easy-way-to-to-obtain-html-free-contents
def textOf(soup):
    return u''.join(soup.findAll(text=True))
 
soup = BeautifulSoup(urllib2.urlopen('http://www.fmylife.com/').read())
 
for item in soup.findAll('div', attrs={'class': 'post article'}):
    item = textOf(item)
    print item[:item.find("FML#")]

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

XML Feeds parsen mit Python 2

Hier ein kurzes Beispiel, wie man mit Python XML Dateien parsen kann. Yahoo Developer hatte dazu einen guten Artikel. Der Datensatz der ECB ist zwar ziemlich doof, da hier mehrere CUBE Tags ineinander verschachtelt sind, dies stellt mit der hier genutzten Herangehensweise kein Hindernis dar.

import xml.etree.ElementTree as ET
import urllib2
 
root = ET.parse(urllib2.urlopen('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml')).getroot()
 
for child in root[2][0]:
    #print child.tag
    #print child.attrib
    curr = child.get('currency')
    rate = child.get('rate')
    print curr, rate

UPDATE for Python 3 and pandas: https://www.uweziegenhagen.de/?p=4569.

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

RSS Feeds parsen mit Python II

Hier eine Erweiterung des ersten Beispiels, das eine LaTeX description Umgebung erzeugt und diese (mittels Tkinter) auch in die Zwischenablage kopiert.

import feedparser
from Tkinter import Tk

# clipboard stuff
r = Tk()
r.withdraw()
r.clipboard_clear()

url = 'http://feeds.feedburner.com/fmylife'
d = feedparser.parse(url)
 
number_entries =  len(d['entries']) - 1
 
head = "\\begin{description}\n"
print head
r.clipboard_append(head)

for i in range(0,number_entries):
    entry = d['entries'][i].summary + "\n" 
    FMLloc = entry.find("FML<")
    item = "\\item[" + str(i+1) + "] " + entry[:FMLloc] + "\n"
    print item
    r.clipboard_append(item)
    
foot = "\\end{description}\n"
print foot
r.clipboard_append(foot)

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

RSS Feeds parsen mit Python

Hier ein kurzes Beispiel, wie man mit Python und dem Feedparser Modul RSS Feeds parsen kann.

import feedparser
url = 'http://feeds.feedburner.com/fmylife'
d = feedparser.parse(url)
 
size =  len(d['entries']) - 1
 
for i in range(0,size):
    entry = d['entries'][i].summary + "\n" 
    FMLloc = entry.find("FML<")
    print entry[:FMLloc]

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Mein erstes ConTeXt Dokument

Hier mein erstes ConTeXt Dokument.

context-1.pdf

\setuppapersize[A4][A3]
\showframe
 
\mainlanguage[de]
 
\setupbodyfont[Garamond Premier Pro,16pt]
 
\starttext
 
Hallo Uwe üöä! Ich bin ein Beispiel für einen Text, der in ConTeXt geschrieben wurde.
 
\startchapter[title=Mein erstes Kapitel,reference=test]
 
Hallo Welt üöä! Ich bin ein Beispiel für einen Text, der in ConTeXt geschrieben wurde.
 
\stopchapter
 
\startsection[title=Mein erste Section]
 
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse eu augue nulla. Etiam vestibulum, diam quis bibendum fringilla, diam libero sollicitudin mauris, sit amet ultricies est arcu tincidunt diam. Morbi porttitor quam a dolor sodales nec condimentum leo volutpat. Praesent lobortis aliquam nulla, eget porta neque congue sit amet. Nam vel venenatis est. Cras luctus, nisi ultrices condimentum laoreet, ligula erat vehicula nunc, vitae pharetra libero neque vehicula justo. Duis pulvinar euismod felis quis porttitor. Aenean urna eros, auctor eget pharetra id, eleifend eu magna. Ut vitae sapien lacus. Aliquam erat volutpat.
 
Aliquam erat volutpat. Maecenas et libero at quam vehicula euismod. Fusce eu sem purus, vel ullamcorper turpis. Aliquam condimentum lacus urna. Vestibulum tempus, dui in accumsan mollis, diam augue accumsan sapien, vitae porta nibh nisl id lacus. Duis lacinia magna sit amet purus hendrerit venenatis. Sed at nisi purus. Nulla in velit non est vulputate fermentum. Etiam eu massa et mauris luctus molestie.
 
Aliquam erat volutpat. Donec fringilla orci eget massa feugiat ut feugiat justo commodo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque venenatis mollis massa, vitae consequat metus dictum eget. Vivamus at sem metus, eget laoreet leo. Aliquam erat volutpat. Nunc ac velit lorem. Mauris vel placerat massa. Aenean id lorem orci. Sed fermentum augue in neque pulvinar mattis. Maecenas quis mi et tellus rhoncus convallis. Etiam sapien dui, vulputate id pellentesque sit amet, tincidunt in elit. Cras convallis felis id tellus cursus id condimentum lectus faucibus. Integer ac accumsan lectus. Integer ullamcorper lobortis ultrices. Pellentesque faucibus vestibulum lacus.
 
Donec congue nunc vitae nulla accumsan ullamcorper. Suspendisse bibendum convallis lorem, vitae suscipit purus ultricies ut. Pellentesque libero erat, convallis vel rhoncus at, fringilla at ligula. Morbi pulvinar rhoncus consequat. Maecenas libero est, accumsan id semper eu, tincidunt luctus velit. Aenean urna ligula, porttitor nec tincidunt eu, sollicitudin vel nisi. Sed nulla lectus, lobortis sed vehicula sed, sagittis in turpis. Ut cursus, ante id sagittis feugiat, mi leo varius lectus, sed mattis dolor massa et quam. Curabitur justo mi, laoreet id dictum in, auctor sed eros. Suspendisse eu lectus purus, pharetra iaculis ligula. Proin velit mauris, varius non rutrum vel, dapibus a lacus.
 
Mauris tincidunt elit non augue fermentum et sodales dolor dapibus. Vivamus eget tellus tellus, nec tincidunt metus. Nunc sit amet pharetra neque. Fusce et adipiscing leo. Nunc at nisi id justo eleifend hendrerit. Phasellus semper porta bibendum. Phasellus mi lectus, auctor eu euismod eu, bibendum nec lorem. Phasellus pellentesque lacus id odio imperdiet ornare. Nulla dignissim euismod sagittis. Praesent bibendum dictum accumsan. Aenean vel sem sit amet urna varius tristique ut in tortor. 
 
\startitemize[a,packed]
\startitem Hallo \stopitem
\startitem Hallo \stopitem
\startitem Hallo \stopitem
\stopitemize
 
\startplacefigure[title=Hallo Welt]
\externalfigure[cow.pdf]
\stopplacefigure
 
$a+b=c$ ^ _
 
\startformula
a+b=c
\stopformula
 
\type{a+2}
 
\startitemize[]
\startitem Hallo \stopitem
\startitem Hallo \stopitem
\startitem Hallo \stopitem
\stopitemize
 
\starttabulate[lp]
aaa \NC bbb dsidhg ifdg fdgifdog  fodg dfgo foigudf ifdogudof g \NR
\stoptabulate
 
\stopsection
\stopchapter
 
\in{chapter}[test]
 
\starttyping
Hallo Welt
\stoptyping
 
\stoptext

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Linotype Reporting Fonts

Vor ein paar Tagen habe ich bei Linotype das Reporting Paket mit drei Fonts gekauft, die sich besonders für die Präsentation von Zahlen eignen sollen. Hier ein Beispiel für die Schriften:

  • Ysobel
  • Finnegan
  • Really No 2 LT Pro Medium

Im Vergleich dazu auf der ersten Seite noch die Computer Modern.

Link zum PDF

\documentclass[10pt]{scrartcl}    
\usepackage[no-math]{fontspec}
\usepackage[landscape, a4paper,left=1cm, right = 2cm,top=1cm, bottom=1cm]{geometry}
\newfontfamily\finnegan{Finnegan LT Pro}
\newfontfamily\really{Really No 2 LT Pro}
\newfontfamily\ysobel{Ysobel Std}
 
\usepackage{polyglossia}
\setmainlanguage{ngerman}
\usepackage{blindtext}
\usepackage[]{booktabs}
\usepackage[]{siunitx}
 
\pagestyle{empty}
 
\newcommand{\mytab}[1]{
\begin{center}
\begin{tabular}{S[table-format = 1.5]S[table-format = 1.5]S[table-format = 1.5]S[table-format = 1.5]S[table-format = 1.5]S[table-format = 1.5]S[table-format = 1.5]S[table-format = 1.5]S[table-format = 1.5]S[table-format = 1.5]S[table-format = 1.5]S[table-format = 1.5]} \\ \toprule[1.5pt]
{#1}	&	{ABCDEFG}	&	{ABCDEFG}	&	{ABCDEFG}	&	{ABCDEFG}	&	{ABCDEFG}	&	{ABCDEFG}	&	{ABCDEFG}	&	{ABCDEFG}	&	{ABCDEFG}	&	{ABCDEFG}	&	{ABCDEFG}	\\	\cmidrule[1pt](rl){1-12}
7.94302	&	7.0045	&	6.3516	&	2.13061	&	0.31487	&	2.64913	&	7.47157	&	0.09458	&	7.46138	&	8.22821	&	9.77846	&	7.90945	\\	
2.44973	&	7.74087	&	8.29646	&	0.55182	&	4.86365	&	1.46329	&	9.55723	&	2.41502	&	5.53236	&	4.42988	&	4.9235	&	0.40665	\\	
0.86302	&	2.75468	&	4.98557	&	3.21322	&	9.00829	&	1.3671	&	5.74489	&	4.63736	&	4.3675	&	4.92115	&	7.00437	&	5.70317	\\	
2.85682	&	1.66832	&	1.95775	&	3.62412	&	5.32679	&	3.73604	&	0.13122	&	6.30802	&	0.27174	&	2.2727	&	1.48592	&	9.80276	\\	
6.86855	&	5.22267	&	0.87031	&	0.10698	&	8.93662	&	8.72108	&	0.3708	&	4.42864	&	5.0803	&	2.05535	&	9.5826	&	9.44556	\\	
5.69722	&	1.78503	&	0.7183	&	9.03343	&	2.83547	&	6.33136	&	3.22168	&	8.62309	&	3.68392	&	5.00893	&	0.38061	&	1.39828	\\	
4.48858	&	7.03363	&	1.07648	&	9.88462	&	0.96759	&	5.46299	&	0.3051	&	9.90832	&	7.57302	&	0.51797	&	0.41257	&	0.57113	\\	
8.46676	&	1.24063	&	1.79223	&	1.74053	&	2.59682	&	9.57971	&	6.55813	&	9.18818	&	1.67851	&	8.77639	&	5.48083	&	0.44952	\\	
0.69618	&	9.13121	&	4.51153	&	9.02808	&	5.01532	&	5.64173	&	3.9541	&	6.40576	&	2.77377	&	0.05439	&	6.09983	&	5.67031	\\	
7.94798	&	3.21021	&	8.25874	&	4.03267	&	3.86395	&	2.55863	&	8.09933	&	9.18547	&	8.73459	&	2.88446	&	6.26101	&	2.06566	\\	
7.93127	&	6.40564	&	3.50873	&	7.96541	&	9.28684	&	9.36379	&	8.56704	&	8.17971	&	6.53507	&	5.445	&	2.88782	&	3.03747	\\	
0.25634	&	0.6703	&	7.3563	&	8.94515	&	2.30245	&	5.20373	&	3.45511	&	8.53806	&	7.86406	&	7.00172	&	3.1559	&	6.4096	\\	
0.19214	&	9.82948	&	5.61463	&	6.29695	&	9.49459	&	1.03274	&	1.42673	&	5.07155	&	2.39584	&	6.88176	&	1.29301	&	4.00332	\\	
8.99739	&	7.14359	&	7.873	&	9.55573	&	5.11091	&	7.31073	&	6.86011	&	3.80771	&	0.98364	&	3.35125	&	0.61988	&	6.9586	\\	
1.6757	&	1.92943	&	8.55235	&	8.822	&	0.13785	&	8.87937	&	4.76512	&	8.23722	&	7.45182	&	0.71984	&	2.67634	&	8.12047	\\	
3.50815	&	6.39615	&	1.97429	&	3.1374	&	1.14165	&	5.54074	&	5.74353	&	5.25622	&	5.43698	&	3.67398	&	2.86708	&	2.08317	\\	
1.15036	&	1.26747	&	4.7325	&	9.00342	&	8.17078	&	1.71118	&	4.34381	&	6.75676	&	5.19866	&	0.93478	&	1.54119	&	1.59709	\\	
3.64751	&	1.38104	&	7.75272	&	0.35374	&	6.40794	&	5.56918	&	7.01769	&	2.60853	&	1.70389	&	4.38278	&	4.1078	&	3.30993	\\	
1.82739	&	0.59515	&	9.49437	&	4.25792	&	2.32978	&	2.58712	&	9.10387	&	8.74875	&	0.30222	&	7.14679	&	0.84774	&	0.23291	\\	
3.97911	&	4.36686	&	8.75359	&	9.08735	&	7.07328	&	4.76685	&	9.22904	&	2.98038	&	7.61817	&	5.32688	&	3.75757	&	2.86522	\\	
4.87776	&	0.37491	&	5.74597	&	9.66477	&	6.42372	&	3.73843	&	1.77754	&	0.34301	&	7.34887	&	5.97278	&	0.77041	&	2.00317	\\	
3.95354	&	8.6647	&	3.4652	&	3.64485	&	5.75569	&	8.48716	&	9.94488	&	4.04227	&	8.07364	&	4.62622	&	5.84647	&	1.48792	\\	
7.54673	&	8.04479	&	4.18514	&	6.00969	&	4.77449	&	9.67473	&	2.77185	&	4.84935	&	4.70896	&	8.73011	&	6.72936	&	3.35326	\\	
8.36664	&	6.79086	&	1.02663	&	6.56035	&	6.20571	&	8.62629	&	3.82555	&	4.07125	&	7.18888	&	3.29265	&	5.32477	&	3.75943	\\	
6.33719	&	3.18132	&	3.49455	&	8.49085	&	6.44534	&	4.32825	&	4.61126	&	0.96681	&	0.12307	&	8.29864	&	2.0481	&	5.88056	\\	
4.06843	&	6.0743	&	4.3543	&	8.85126	&	1.67312	&	4.85998	&	9.45324	&	8.71716	&	5.33461	&	8.1797	&	6.54954	&	9.60386	\\	
7.32349	&	1.80706	&	9.56949	&	6.36207	&	0.36908	&	8.26054	&	1.23099	&	8.24219	&	6.38496	&	8.31609	&	8.15205	&	0.73903	\\	
6.35861	&	5.70684	&	9.44818	&	9.60758	&	1.5001	&	4.55732	&	9.53303	&	8.13546	&	4.89822	&	8.1567	&	3.1509	&	2.74759	\\	
0.28756	&	6.29778	&	4.42499	&	8.13192	&	7.51566	&	0.92517	&	6.42936	&	4.49255	&	5.14069	&	0.76525	&	8.47158	&	7.76271	\\	
0.68746	&	7.19351	&	0.93501	&	8.1985	&	1.91107	&	3.17524	&	4.19252	&	5.47127	&	7.38539	&	1.36545	&	0.91629	&	3.72313	\\	
5.79965	&	1.42186	&	7.54618	&	4.50008	&	1.2426	&	0.61943	&	8.35699	&	4.39152	&	4.9161	&	2.92314	&	7.54541	&	3.60052	\\	
3.76313	&	2.70867	&	0.15364	&	6.62638	&	5.61816	&	9.76758	&	5.71712	&	1.14827	&	4.16962	&	9.43977	&	9.72673	&	7.67609	\\	
5.0189	&	8.60198	&	3.74426	&	4.77381	&	4.9633	&	3.24327	&	1.90609	&	7.00512	&	9.39634	&	0.03789	&	3.89681	&	5.8926	\\	
5.32982	&	1.54378	&	0.13064	&	7.85819	&	6.08736	&	2.83944	&	1.00555	&	0.80578	&	0.54143	&	5.70053	&	4.71767	&	7.76684	\\	
1.19166	&	5.41682	&	0.30345	&	4.98344	&	9.57099	&	1.69805	&	5.07077	&	1.86303	&	1.70586	&	9.62287	&	1.0191	&	7.96223	\\	
6.71961	&	7.73304	&	8.24259	&	9.75063	&	4.79749	&	0.29445	&	0.85133	&	4.87869	&	5.51599	&	5.50993	&	4.07042	&	5.56926	\\	
6.84149	&	9.00838	&	0.46989	&	3.17645	&	1.33993	&	3.26956	&	0.30287	&	4.56774	&	9.44845	&	4.74544	&	1.98702	&	4.44703	\\	
9.50374	&	5.32674	&	6.97746	&	0.66691	&	0.2128	&	9.12159	&	7.10556	&	9.88283	&	5.83612	&	9.82199	&	5.01858	&	5.37625	\\	
6.52654	&	8.02151	&	1.67545	&	9.51776	&	7.56389	&	5.31561	&	8.84552	&	2.71815	&	6.23715	&	0.52647	&	0.37706	&	0.2713	\\	
5.28738	&	2.13936	&	6.37936	&	8.14369	&	7.72196	&	9.42522	&	1.11877	&	3.81098	&	8.87274	&	9.84429	&	6.78509	&	9.42527	\\	
9.2364	&	3.64272	&	5.66821	&	8.42346	&	0.55616	&	6.89716	&	6.28835	&	2.73306	&	3.4833	&	9.19093	&	0.40727	&	3.57561	\\	\bottomrule[1.5pt] \end{tabular}%
\end{center}%
}
 
\begin{document}
 
\mytab{CModern}
 
\finnegan
\mytab{Finnegan}
 
\really
\mytab{Really}
 
\ysobel
\mytab{Ysobel}
 
\end{document}

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Das Linotype Monospace Paket

Vor einiger Zeit habe ich bei Linotype fünf Monospaced-Schriften gekauft, um diese mit LaTeX zu nutzen. Dank der eingebauten Systemfont-Unterstützung von XeTeX/LuaTeX ist das auch kein Akt. Hier ein Beispiel für die Schnitte:

PDF

\documentclass{scrartcl}    
\usepackage[no-math]{fontspec}
\usepackage[left=1cm, right = 2cm,top=1cm, bottom=1cm]{geometry}
\newfontfamily\schmutz{Schmutz Pro}
\newfontfamily\american{Typo American Com}
\newfontfamily\univers{Univers Next Typewriter Pro}
\newfontfamily\souvenir{Souvenir Monospaced ITC Pro}
\newfontfamily\helv{Helvetica Monospaced W1G}
 
\usepackage{polyglossia}
\setmainlanguage{ngerman}
\usepackage{blindtext}
 
\begin{document}
 
{\helv \textbf{Schmutz Pro:}}
\schmutz
\blindtext
 
{\helv \textbf{Typo American Com:}}
\american
\blindtext
 
{\helv \textbf{Univers Next Typewriter Pro:}}
\univers
\blindtext
 
{\helv \textbf{Souvenir Monospaced ITC Pro:}}
\souvenir
\blindtext
 
{\helv \textbf{Helvetica Monospaced W1G:}}
\helv
\blindtext
\end{document}

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Namen zerlegen mit Excel

Vor ein paar Tagen hatte ich die Aufgabe, Namen der Form „Mustermann Max und Manuela“ in die einzelnen Bestandteile zu zerlegen, um die Namen der einzelnen Ehepartner getrennt ausgeben zu können. Es wäre zwar einfacher gewesen, ein entsprechendes VBA Makro zu schreiben, das die vier Werte zurückliefert, die Lösung wollte ich aber nur mit Formeln bauen. Die folgenden vier Formeln wurden für die Lösung genutzt:

  • Länge("Zelle"): Gibt die Länge des Inhalts einer Zelle aus, als z.B. 5, wenn eine Zelle „abcde“ enthält.
  • Links("Zelle"; "Zeichen"): Gibt vom Zellinhalt in „Zelle“ die linken „Zeichenzahl“ Zeichen zurück.
  • Rechts("Zelle"; "Zeichen"): Gibt vom Zellinhalt in die rechten „Zeichenzahl“ Zeichen zurück.
  • Finden("Suchtext","Zelle",[Startposition]): sucht den Inhalt von „Suchtext“ in Zelle „Zelle“. Optional kann über [Startposition] angegeben werden, ab welchem Zeichen die Funktion mit dem Suchen beginnen soll.

Mit der Kombination dieser vier Formeln können wir jetzt die Zeichenkette bearbeiten:

Mustermann

Das „Mustermann“ zu isolieren ist noch relativ einfach: Zum Nachnamen gehört alles bis zum ersten Leerzeichen. Das Leerzeichen finden wir dynamisch, indem wir mittels Finden() danach suchen. Als Formel erhalten wir (wenn der komplette Name in Zelle B3 steht):

=LINKS(B3;FINDEN(" ";B3))

Max

Um den „Max“ aus der Zeichenkette zu extrahieren, gibt es verschiedene Möglichkeiten. Neben der gleich vorgestellten könnten wir auch mittels wechseln() das „Mustermann“ aus dem String löschen und dann die oben genutzte Formel nutzen. Ich mache es jedoch ein wenig anders, indem ich nach dem zweiten Leerzeichen suche und mir mit Links() den Text links davon zurückgeben lasse:

=LINKS(B3;FINDEN(" ";B3;1+FINDEN(" ";B3)))

Ich nutze dabei die Tatsache, dass ich Finden() mitgeben kann, an welcher Stelle es denn mit der Suche beginnen soll. Und diese Stelle ist genau die Position des ersten Leerzeichens plus 1.

Jetzt habe ich „Mustermann Max“ in einer Zelle. Nun kann ich a) die Länge dieser Zeichenkette bestimmen, b) das Leerzeichen suchen und c) aus der Differenz zwischen Länge und Fundort die Anzahl der Zeichen ermitteln, die ich von rechts entnehmen muss:

=RECHTS(D3;LÄNGE(D3)-FINDEN(" ";D3))

Manuela

Der einfachste Weg, das „Manuela“ zu extrahieren, wäre über eine VBA Funktion, die die Zeichenkette umdreht, dort das dann erste Leerzeichen sucht und den entsprechenden Text zurückgibt. Geht aber auch kompliziert, in diesem Fall auch ohne Hilfsspalte.

Wie eben schon nutze ich Rechts() um den String zu extrahieren. Ich nutze aber eine dreifach verschachtelte Finden() Funktion, um das dritte Leerzeichen zu ermitteln. Alles, was rechts vom dritten Leerzeichen steht, ist unser gesuchter Name.

=RECHTS(B3;LÄNGE(B3)-FINDEN(" ";B3;1+FINDEN(" ";B3;1+FINDEN(" ";B3))))

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

LaTeX-Template für Speisekarten

Hier ein kleines Beispiel für Speisekarten.

PDF

\documentclass[12pt,ngerman]{article}
 
\usepackage[a5paper,left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{booktabs}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{csquotes}
\usepackage{paralist}
\usepackage{xcolor}
\usepackage[]{blindtext}
\pagestyle{empty}
 
\begin{document}
\begin{twocolumn}
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß mit Salat\dotfill6,50
\item Hirtenspieß\dotfill4,50
 
\end{compactitem}
 
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\subsection*{Grillspezialitäten}
 
\begin{compactenum}
\item \textbf{Hirtenspieß}\newline mit lecker Fleisch\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactenum}
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\subsection*{Kalte Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\subsection*{Warme Vorspeisen}
 
\begin{compactitem}[]
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\item Hirtenspieß\dotfill6,50
\end{compactitem}
 
\end{twocolumn}
\end{document}

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Reports erzeugen mit Powershell

Heute bekam ich von einer Leserin meines Blogs folgendes Powershell Skript zugesandt, das alle Bilder größer 1MB sucht in in einer HTML Datei auflistet, die dann verschickt wird.

Vielen Dank an Andrea!

"
$a = $a + "BODY{background-color:#ffffff;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:grey}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:#ffffff}"
$a = $a + ""

gci "C:\Users\Uwe\" -recurse -include *.jpg,*.bmp,*.png | Where-Object {$_.Length -gt 1000KB} |
? { $_.PSisContainer -eq $false} |
Sort-Object length -descending | Select-Object Name, @{Name="Kbytes";Expression={ "{0:N0}" -f ($_.Length / 1Kb) }}, DirectoryName, CreationTime | ConvertTo-HTML -head $a -body "

Grosse Bilder

" | out-file "C:\report.htm" #Send Email $msg = $null $smtpServer = "0.0.0.0" $workpath = “\\Server\Share\Verzeichnis” $file = “$workpath\report.htm” $msg = new-object Net.Mail.MailMessage $att = new-object Net.Mail.Attachment($file) $smtp = new-object Net.Mail.SmtpClient($smtpServer) $msg.From = "sender@domain.com" $msg.To.Add("empfaenger@domain.com") #$msg.To.Add("empfaenger2@domain.com") $msg.Subject = "Bilder Report" $msg.IsBodyHTML = $true $html = "Report der Bilder" $msg.Body = $html $msg.Attachments.Add($att) $smtp.Send($msg)

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website