PlatinStandard
Cadet 4th Year
- Registriert
- Okt. 2011
- Beiträge
- 84
Guten Tag!
Ich hab eine XML Datei die mit einem PDF Paser erstellt wurde.
Hier ein Auszug aus der XML Datei.
<?xml version="1.0" encoding="UTF-8"?>
<PDF>
<DocumentInfo>
<Author>XXXXX</Author>
<Creator>Form YMR_PRINT_ERS EN</Creator>
<Producer>SAP NetWeaver 750 </Producer>
<CreationDate>2018-01-18T11:40:03Z</CreationDate>
</DocumentInfo>
<FormData />
<Pages quantity="17">
<Page nr="1" height="842.0" width="595.0" rotation="0">
<Fonts>
<Font name="C001" type="Font" baseFont="Courier" />
<Font name="C002" type="Font" baseFont="Courier-Bold" />
<Font name="C003" type="Font" baseFont="CourierNew" />
<Font name="C004" type="Font" baseFont="Helvetica-Bold" />
<Font name="C005" type="Font" baseFont="Helvetica" />
</Fonts>
<Images />
<TextLines>
<LineData font="C002" size="10" xpos="50" ypos="698">Seller:</LineData>
<LineData font="C002" size="14" xpos="310" ypos="698">Invoice Self-billing Original</LineData>
<LineData font="C001" size="12" xpos="50" ypos="686">my company</LineData>
<LineData font="C005" size="12" xpos="468" ypos="679">Page: 1 / 17 </LineData>
<LineData font="C001" size="12" xpos="50" ypos="674">xxxxx</LineData>
<LineData font="C003" size="12" xpos="50" ypos="674">C</LineData>
<LineData font="C001" size="12" xpos="50" ypos="674">xxxxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="674">Document no. / Date </LineData>
<LineData font="C005" size="8" xpos="468" ypos="674">Currency</LineData>
<LineData font="C001" size="12" xpos="50" ypos="662">xxxxx</LineData>
<LineData font="C001" size="10" xpos="310" ypos="662">xxxx / xxxx</LineData>
<LineData font="C001" size="10" xpos="468" ypos="662">EUR</LineData>
<LineData font="C001" size="12" xpos="50" ypos="650">xxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="650">FI document no. / Date</LineData>
<LineData font="C001" size="10" xpos="310" ypos="638">xxxx/ xxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="626">Your vendor number in our co. </LineData>
<LineData font="C005" size="8" xpos="468" ypos="626">Your tax ID number</LineData>
<LineData font="C002" size="10" xpos="50" ypos="614">Buyer:</LineData>
<LineData font="C001" size="10" xpos="310" ypos="614">xxxx</LineData>
<LineData font="C001" size="10" xpos="468" ypos="614">xxxxx</LineData>
<LineData font="C001" size="12" xpos="50" ypos="602">xxxxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="602">Our customer no. in your co. </LineData>
<LineData font="C005" size="8" xpos="468" ypos="602">Our tax ID number</LineData>
<LineData font="C001" size="12" xpos="50" ypos="590">xxx</LineData>
<LineData font="C001" size="10" xpos="468" ypos="590">xxx</LineData>
<LineData font="C001" size="12" xpos="50" ypos="578">1xxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="578">Vendor invoice number</LineData>
<LineData font="C001" size="10" xpos="310" ypos="566">xxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="554">Processed by </LineData>
<LineData font="C005" size="8" xpos="468" ypos="554">Your tax number</LineData>
<LineData font="C001" size="10" xpos="310" ypos="542">Ms. xxxx </LineData>
<LineData font="C001" size="10" xpos="468" ypos="542">xxxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="530">Telephone no.</LineData>
<LineData font="C005" size="8" xpos="361" ypos="530"> / Fax no. </LineData>
<LineData font="C001" size="10" xpos="310" ypos="518">xxxxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="506">Delivery date: See attachment</LineData>
<LineData font="C001" size="10" xpos="310" ypos="494">07.01.2018</LineData>
<LineData font="C005" size="8" xpos="310" ypos="482">E-mail address</LineData>
<LineData font="C001" size="10" xpos="310" ypos="470">xxx@xxxx.com</LineData>
<LineData font="C001" size="12" xpos="50" ypos="426">As agreed, we have settled the following goods and :services and</LineData>
<LineData font="C001" size="12" xpos="50" ypos="416">credited the amounts to your account in our company::</LineData>
<LineData font="C001" size="12" xpos="50" ypos="406">___________________________________________________:____________________</LineData>
<LineData font="C002" size="12" xpos="50" ypos="385">Item</LineData>
<LineData font="C002" size="12" xpos="94" ypos="385">Material</LineData>
<LineData font="C002" size="12" xpos="266" ypos="385">Description</LineData>
<LineData font="C001" size="12" xpos="94" ypos="372">Shipment</LineData>
<LineData font="C001" size="12" xpos="94" ypos="359">Purchase Order</LineData>
<LineData font="C001" size="12" xpos="94" ypos="346">SEnt line </LineData>
<LineData font="C001" size="12" xpos="230" ypos="346">Service text</LineData>
<LineData font="C001" size="12" xpos="94" ypos="334">INT. SERVICE NO. </LineData>
<LineData font="C001" size="12" xpos="230" ypos="334">EXT. SERVICE NO.</LineData>
<LineData font="C001" size="12" xpos="94" ypos="322">QTY </LineData>
<LineData font="C001" size="12" xpos="230" ypos="322">UN</LineData>
<LineData font="C001" size="12" xpos="432" ypos="322">NET VALUE IN EUR</LineData>
<LineData font="C002" size="12" xpos="94" ypos="310">Qty</LineData>
<LineData font="C002" size="12" xpos="230" ypos="310">Un</LineData>
<LineData font="C002" size="12" xpos="338" ypos="310">TaxC</LineData>
<LineData font="C002" size="12" xpos="432" ypos="310">Net value in EUR</LineData>
<LineData font="C002" size="12" xpos="230" ypos="298">Price/UoM</LineData>
<LineData font="C002" size="12" xpos="338" ypos="298">VAT amount</LineData>
<LineData font="C002" size="12" xpos="439" ypos="298">Gross value EUR</LineData>
<LineData font="C001" size="12" xpos="50" ypos="287">___________________________________________________:____________________</LineData>
<LineData font="C002" size="12" xpos="50" ypos="263">00001</LineData>
<LineData font="C002" size="12" xpos="94" ypos="263">Freight charges (see enclosed)</LineData>
<LineData font="C001" size="12" xpos="94" ypos="248">0070492</LineData>
<LineData font="C001" size="12" xpos="216" ypos="248">/ 22.12.2017</LineData>
<LineData font="C001" size="12" xpos="94" ypos="236">7000370</LineData>
<LineData font="C001" size="12" xpos="216" ypos="236">/ 00001</LineData>
<LineData font="C002" size="12" xpos="72" ypos="224"> 1</LineData>
<LineData font="C002" size="12" xpos="230" ypos="224">AU</LineData>
<LineData font="C002" size="12" xpos="432" ypos="224"> 525,00</LineData>
<LineData font="C002" size="12" xpos="230" ypos="212">525,00</LineData>
<LineData font="C002" size="12" xpos="346" ypos="212">0,00</LineData>
<LineData font="C002" size="12" xpos="504" ypos="212">525,00</LineData>
<LineData font="C002" size="12" xpos="50" ypos="185">00002</LineData>
<LineData font="C002" size="12" xpos="94" ypos="185">Freight charges (see enclosed)</LineData>
<LineData font="C001" size="12" xpos="94" ypos="170">0070492</LineData>
<LineData font="C001" size="12" xpos="216" ypos="170">/ 02.01.2018</LineData>
<LineData font="C001" size="12" xpos="94" ypos="158">7000370</LineData>
<LineData font="C001" size="12" xpos="216" ypos="158">/ 00001</LineData>
<LineData font="C002" size="12" xpos="72" ypos="146"> 1</LineData>
<LineData font="C002" size="12" xpos="230" ypos="146">AU</LineData>
<LineData font="C002" size="12" xpos="432" ypos="146"> 670,00</LineData>
<LineData font="C002" size="12" xpos="230" ypos="134">670,00</LineData>
<LineData font="C002" size="12" xpos="346" ypos="134">0,00</LineData>
<LineData font="C002" size="12" xpos="504" ypos="134">670,00</LineData>
<LineData font="C004" size="8" xpos="50" ypos="79">Kunde GMBH</LineData>
Nun soll aus dieser XML Datei eine CSV Datei generiert werden.
Es soll nach dem Text: "Freight charges (see enclosed)" gesucht werden und der Inhalt aus den nächsten elf Zeilen genommen werden und diese dann nebeneinander in eine CSV Datei geschirben werden.
Wird der Text "Freight charges (see enclosed)" nochmal gefunden, soll eine neue Zeile in der CSV Datei begeonnen werden.
Wenn der Text "Total" gefunden wird, soll nicht weiter im XML Dokument gesucht werden.
Hat jemand eine Idee, wie ich dies Umsetzen kann?
Ich hab eine XML Datei die mit einem PDF Paser erstellt wurde.
Hier ein Auszug aus der XML Datei.
<?xml version="1.0" encoding="UTF-8"?>
<PDF>
<DocumentInfo>
<Author>XXXXX</Author>
<Creator>Form YMR_PRINT_ERS EN</Creator>
<Producer>SAP NetWeaver 750 </Producer>
<CreationDate>2018-01-18T11:40:03Z</CreationDate>
</DocumentInfo>
<FormData />
<Pages quantity="17">
<Page nr="1" height="842.0" width="595.0" rotation="0">
<Fonts>
<Font name="C001" type="Font" baseFont="Courier" />
<Font name="C002" type="Font" baseFont="Courier-Bold" />
<Font name="C003" type="Font" baseFont="CourierNew" />
<Font name="C004" type="Font" baseFont="Helvetica-Bold" />
<Font name="C005" type="Font" baseFont="Helvetica" />
</Fonts>
<Images />
<TextLines>
<LineData font="C002" size="10" xpos="50" ypos="698">Seller:</LineData>
<LineData font="C002" size="14" xpos="310" ypos="698">Invoice Self-billing Original</LineData>
<LineData font="C001" size="12" xpos="50" ypos="686">my company</LineData>
<LineData font="C005" size="12" xpos="468" ypos="679">Page: 1 / 17 </LineData>
<LineData font="C001" size="12" xpos="50" ypos="674">xxxxx</LineData>
<LineData font="C003" size="12" xpos="50" ypos="674">C</LineData>
<LineData font="C001" size="12" xpos="50" ypos="674">xxxxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="674">Document no. / Date </LineData>
<LineData font="C005" size="8" xpos="468" ypos="674">Currency</LineData>
<LineData font="C001" size="12" xpos="50" ypos="662">xxxxx</LineData>
<LineData font="C001" size="10" xpos="310" ypos="662">xxxx / xxxx</LineData>
<LineData font="C001" size="10" xpos="468" ypos="662">EUR</LineData>
<LineData font="C001" size="12" xpos="50" ypos="650">xxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="650">FI document no. / Date</LineData>
<LineData font="C001" size="10" xpos="310" ypos="638">xxxx/ xxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="626">Your vendor number in our co. </LineData>
<LineData font="C005" size="8" xpos="468" ypos="626">Your tax ID number</LineData>
<LineData font="C002" size="10" xpos="50" ypos="614">Buyer:</LineData>
<LineData font="C001" size="10" xpos="310" ypos="614">xxxx</LineData>
<LineData font="C001" size="10" xpos="468" ypos="614">xxxxx</LineData>
<LineData font="C001" size="12" xpos="50" ypos="602">xxxxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="602">Our customer no. in your co. </LineData>
<LineData font="C005" size="8" xpos="468" ypos="602">Our tax ID number</LineData>
<LineData font="C001" size="12" xpos="50" ypos="590">xxx</LineData>
<LineData font="C001" size="10" xpos="468" ypos="590">xxx</LineData>
<LineData font="C001" size="12" xpos="50" ypos="578">1xxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="578">Vendor invoice number</LineData>
<LineData font="C001" size="10" xpos="310" ypos="566">xxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="554">Processed by </LineData>
<LineData font="C005" size="8" xpos="468" ypos="554">Your tax number</LineData>
<LineData font="C001" size="10" xpos="310" ypos="542">Ms. xxxx </LineData>
<LineData font="C001" size="10" xpos="468" ypos="542">xxxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="530">Telephone no.</LineData>
<LineData font="C005" size="8" xpos="361" ypos="530"> / Fax no. </LineData>
<LineData font="C001" size="10" xpos="310" ypos="518">xxxxx</LineData>
<LineData font="C005" size="8" xpos="310" ypos="506">Delivery date: See attachment</LineData>
<LineData font="C001" size="10" xpos="310" ypos="494">07.01.2018</LineData>
<LineData font="C005" size="8" xpos="310" ypos="482">E-mail address</LineData>
<LineData font="C001" size="10" xpos="310" ypos="470">xxx@xxxx.com</LineData>
<LineData font="C001" size="12" xpos="50" ypos="426">As agreed, we have settled the following goods and :services and</LineData>
<LineData font="C001" size="12" xpos="50" ypos="416">credited the amounts to your account in our company::</LineData>
<LineData font="C001" size="12" xpos="50" ypos="406">___________________________________________________:____________________</LineData>
<LineData font="C002" size="12" xpos="50" ypos="385">Item</LineData>
<LineData font="C002" size="12" xpos="94" ypos="385">Material</LineData>
<LineData font="C002" size="12" xpos="266" ypos="385">Description</LineData>
<LineData font="C001" size="12" xpos="94" ypos="372">Shipment</LineData>
<LineData font="C001" size="12" xpos="94" ypos="359">Purchase Order</LineData>
<LineData font="C001" size="12" xpos="94" ypos="346">SEnt line </LineData>
<LineData font="C001" size="12" xpos="230" ypos="346">Service text</LineData>
<LineData font="C001" size="12" xpos="94" ypos="334">INT. SERVICE NO. </LineData>
<LineData font="C001" size="12" xpos="230" ypos="334">EXT. SERVICE NO.</LineData>
<LineData font="C001" size="12" xpos="94" ypos="322">QTY </LineData>
<LineData font="C001" size="12" xpos="230" ypos="322">UN</LineData>
<LineData font="C001" size="12" xpos="432" ypos="322">NET VALUE IN EUR</LineData>
<LineData font="C002" size="12" xpos="94" ypos="310">Qty</LineData>
<LineData font="C002" size="12" xpos="230" ypos="310">Un</LineData>
<LineData font="C002" size="12" xpos="338" ypos="310">TaxC</LineData>
<LineData font="C002" size="12" xpos="432" ypos="310">Net value in EUR</LineData>
<LineData font="C002" size="12" xpos="230" ypos="298">Price/UoM</LineData>
<LineData font="C002" size="12" xpos="338" ypos="298">VAT amount</LineData>
<LineData font="C002" size="12" xpos="439" ypos="298">Gross value EUR</LineData>
<LineData font="C001" size="12" xpos="50" ypos="287">___________________________________________________:____________________</LineData>
<LineData font="C002" size="12" xpos="50" ypos="263">00001</LineData>
<LineData font="C002" size="12" xpos="94" ypos="263">Freight charges (see enclosed)</LineData>
<LineData font="C001" size="12" xpos="94" ypos="248">0070492</LineData>
<LineData font="C001" size="12" xpos="216" ypos="248">/ 22.12.2017</LineData>
<LineData font="C001" size="12" xpos="94" ypos="236">7000370</LineData>
<LineData font="C001" size="12" xpos="216" ypos="236">/ 00001</LineData>
<LineData font="C002" size="12" xpos="72" ypos="224"> 1</LineData>
<LineData font="C002" size="12" xpos="230" ypos="224">AU</LineData>
<LineData font="C002" size="12" xpos="432" ypos="224"> 525,00</LineData>
<LineData font="C002" size="12" xpos="230" ypos="212">525,00</LineData>
<LineData font="C002" size="12" xpos="346" ypos="212">0,00</LineData>
<LineData font="C002" size="12" xpos="504" ypos="212">525,00</LineData>
<LineData font="C002" size="12" xpos="50" ypos="185">00002</LineData>
<LineData font="C002" size="12" xpos="94" ypos="185">Freight charges (see enclosed)</LineData>
<LineData font="C001" size="12" xpos="94" ypos="170">0070492</LineData>
<LineData font="C001" size="12" xpos="216" ypos="170">/ 02.01.2018</LineData>
<LineData font="C001" size="12" xpos="94" ypos="158">7000370</LineData>
<LineData font="C001" size="12" xpos="216" ypos="158">/ 00001</LineData>
<LineData font="C002" size="12" xpos="72" ypos="146"> 1</LineData>
<LineData font="C002" size="12" xpos="230" ypos="146">AU</LineData>
<LineData font="C002" size="12" xpos="432" ypos="146"> 670,00</LineData>
<LineData font="C002" size="12" xpos="230" ypos="134">670,00</LineData>
<LineData font="C002" size="12" xpos="346" ypos="134">0,00</LineData>
<LineData font="C002" size="12" xpos="504" ypos="134">670,00</LineData>
<LineData font="C004" size="8" xpos="50" ypos="79">Kunde GMBH</LineData>
Nun soll aus dieser XML Datei eine CSV Datei generiert werden.
Es soll nach dem Text: "Freight charges (see enclosed)" gesucht werden und der Inhalt aus den nächsten elf Zeilen genommen werden und diese dann nebeneinander in eine CSV Datei geschirben werden.
Wird der Text "Freight charges (see enclosed)" nochmal gefunden, soll eine neue Zeile in der CSV Datei begeonnen werden.
Wenn der Text "Total" gefunden wird, soll nicht weiter im XML Dokument gesucht werden.
Hat jemand eine Idee, wie ich dies Umsetzen kann?