title: Want to write (or use an existing?) UDF to read a file with a multi-character delimiter
body: <p>I'd like to read a data file in Pig that uses a multi-character delimiter to separate fields (I've no requirement to write files this way). So my Pig Script will look something like:</p>
  
  <pre><code>myData = LOAD 'myFile' USING PigStorage(‘~|~’) as (col1:chararray, col2:chararray); 
  </code></pre>
  
  <p>My issue is that PigStorage doesn't support multi-character delimiters.</p>
  
  <p>Possible solutions are:</p>
  
  <ol>
  <li>An existing UDF. Does one exist?</li>
  <li>A custom UDF based on a <strong>working</strong> example of a UDF that reads files. </li>
  </ol>
  
  <p>With respect to the second point, I've seen the much copied <a href="https://pig.apache.org/docs/r0.15.0/udf.html#load-store-functions" rel="nofollow">pig.apache.org example</a>, but the trouble is that this code won't compile (aside from the obvious syntax error, all the import statements are missing so I don't know which version of classes need to be imported!) </p>