title: Generate an MDF finite element mesh containing LINK1 elements
body: <p>I got the following homework on the university:</p>
  
  <blockquote>
    <p>Write an AWK program, that can generate an MDF finite element mesh
    containing LINK1 elements. The geometry of the mesh contains n pieces
    of vertical lines and m pieces of horizontal lines. n and m values are
    parameters for the AWK program. The vertical and horizontal distance
    between the lines are also parameters. The shape of the mesh can be
    seen in the following figure:</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/59Mkh.png" rel="nofollow noreferrer">the shape of the mesh</a></p>
  
  <p>An example execution:</p>
  
  <pre><code>awk –v n=3 –v m=2 –v dn=2 –v dm=1 –f gen.awk &gt; output.mdf
  </code></pre>
  
  <blockquote>
    <p>Inputs:</p>
  </blockquote>
  
  <p><code>n</code> is the number of vertical lines</p>
  
  <p><code>m</code> is the number of horizontal lines</p>
  
  <p><code>dn</code> is the number of characters between the vertical lines</p>
  
  <p><code>dm</code> is the number of characters between the horizontal lines</p>
  
  <blockquote>
    <p>Output:</p>
  </blockquote>
  
  <p>the <code>output.mdf</code> is the Measurement Data Format file i need to draw these lines in. </p>
  
  <p>Like in this:</p>
  
  <pre><code>__|__|__|__
  __|__|__|__
    |  |  |
  </code></pre>
  
  <p>And also:</p>
  
  <blockquote>
    <p>Please make sure the output.mdf file is valid. It is possible to use
    the chkmdf.exe or e_plot32.exe program to check the validity of an MDF
    file.</p>
  </blockquote>
  
  <p><strong>Don't get me wrong I don't want someone to solve it for me, I know this platform is not for that. I only ask for some starter tips, documents</strong></p>