title: How to read a file and write into a text file?
body: <p>I want to open mis file, copy all the data and write into a text file.</p>
  
  <p>My mis file.</p>
  
  <p>File name – 1.mis</p>
  
  <pre><code>M3;3395;44;0;1;;20090404;094144;8193;3;0;;;;
  M3;3397;155;0;2;;20090404;105941;8193;3;0;;;;
  M3;3396;160;0;1;;20090404;100825;8193;3;0;;;;
  M3;3398;168;0;2;;20090404;110106;8193;3;0;;;;
  </code></pre>
  
  <p>so on...,</p>
  
  <p>The above data should appear in a text file with same file name (1.txt).</p>
  
  <p>I tried this code.</p>
  
  <pre><code>Dim sFileText As String
  Dim iFileNo As Integer
  iFileNo = FreeFile
  Open "C:\Clients\Converter\Clockings.mis" For Input As #iFileNo
  Do While Not EOF(iFileNo)
  Input #iFileNo, sFileText
  Loop
  Close #iFileNo
  
  Open "C:\Clients\Converter\2.txt" For Output As #iFileNo
  Do While Not EOF(iFileNo)
  Write #iFileNo, sFileText
  Loop
  Close #iFileNo
  </code></pre>
  
  <p>Nothing is saved in 1.txt.</p>