title: JRecord - Formatting file transferred from Mainframe
body: <p>I am trying to display a mainframe file in a eclipse RCP application using <a href="http://jrecord.sourceforge.net/" rel="nofollow">JRecord</a> library.I already have the COBOL copybook as a text file. 
  to accomplish that,</p>
  
  <ol>
  <li>I am transferring the file from mainframe to my desktop through
  apache commons net FTPClient API</li>
  <li>Now I have a text file</li>
  <li>I am removing the newline and carriage return characters</li>
  <li>then I read it via ., a CobolIoProvider and convert it into a ArrayList of type AbstractLine</li>
  </ol>
  
  <p>But I have offset issues because of some special charcters .
  here are the issues</p>
  
  <ol>
  <li>when I dont perform step #3 , there are offset issues right from
  record 1. hence I included step #3</li>
  <li>even when I perform step #3 , the first few thounsands of records seem to be formatted(or read ) by the AbstractLineReader correctly unless it encounters a special character (not sure but thats my assumption). </li>
  </ol>
  
  <p>Code snippet:</p>
  
  <pre><code>ArrayList&lt;AbstractLine&gt; lines = new ArrayList&lt;AbstractLine&gt;();
          InputStream copyStream;
          InputStream fis;
          try {
              copyStream = new FileInputStream(new File(copybookfile));
  
              String filec = FileUtils.readFileToString(new File(datafile));
              System.out.println("initial len: "+filec.length());
              filec=filec.replaceAll("\r", "");
              filec=filec.replaceAll("\n", "");
              System.out.println("initial len: "+filec.length());
  
              fis= new ByteArrayInputStream(filec.getBytes());
  
              CobolIoProvider ioProvider = CobolIoProvider.getInstance();
              AbstractLineReader reader = ioProvider.newIOBuilder(copyStream, "REQUEST",
                      Convert.FMT_MAINFRAME).newReader(fis);
              AbstractLine line;
              while ((line = reader.read()) != null) {
                  lines.add(line);
              }
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>What am I missing here ? is there an additional preprocessing that I need to do for the file transferred from mainframe ?</p>