title: How do I read the delivery date from Edifact d96a .txt-file?
body: <p>I have a problem retrieving the delivery date from .txt-file sent with EDI.</p>
  
  <p>My customers have to opportunity to set the line in a .txt-file:</p>
  
  <p><em>'DTM+76:<strong>20160702</strong>:102</em></p>
  
  <p>when they order something from the website to set delivery date for future deliveries.</p>
  
  <p>I want to get the date (in this case 2016-07-02) and set it to the deliveryDate-variable (and then set it in the database).</p>
  
  <p>I am thinking about using Scanner in java to see if the file contains the text "DTM:76" and then read the date-part of the line like <a href="https://stackoverflow.com/questions/20418319/find-a-string-or-a-line-in-a-txt-file-java">Find a string (or a line) in a txt File Java</a> . Is it possible/effective with EDI or is there a better way to do it? </p>
  
  <p>The best solution for me would be something like this:</p>
  
  <pre><code>    if (DTM+76:YYYYMMDD::102 exists)
              {
                  //set the deliveryDate by getting only YYYYMMDD from DTM:76:20160702:102
                  deliveryDate= get..("20160702");
              }
  </code></pre>
  
  <p>Info about EDI and delivery dates: <a href="http://www.gs1.org/sites/default/files/docs/eancom/ean02s4/part2/insdes/053.htm" rel="nofollow noreferrer">http://www.gs1.org/sites/default/files/docs/eancom/ean02s4/part2/insdes/053.htm</a> 
  <a href="https://www.stylusstudio.com/edifact/D96A/ORDERS.htm" rel="nofollow noreferrer">https://www.stylusstudio.com/edifact/D96A/ORDERS.htm</a></p>
  
  <p>Any suggestions? </p>