title: Parsing a fixed-width formatted file in Java
body: <p>I've got a file from a vendor that has 115 fixed-width fields per line. How can I parse that file into the 115 fields so I can use them in my code?</p>
  
  <p>My first thought is just to make constants for each field like <code>NAME_START_POSITION</code> and <code>NAME_LENGTH</code> and using <code>substring</code>. That just seems ugly, so I'm curious about better ways of doing this. None of the couple of libraries a Google search turned up seemed any better, either.</p>