title: PIG TRIM and UPPER
body: <p>I am new to Hadoop programming, looking for help in pig. I have data coming from <code>simple.txt</code> format as <code>,</code> delimeter. I have two use cases. I want to do <code>ltrim(rtrim())</code> on all the columns and turn to <code>UPPER</code> for selected fields.</p>
  
  <p>Here is my script:</p>
  
  <pre><code>party = Load '/party_test_pig.txt' USING PigStorage(',') AS(....);
  Trim_party = FOREACH Upper_party GENERATE TRIM(*);
  Upper_party = FOREACH party GENERATE UPPER(col1), UPPER(col2), UPPER(col3);
  </code></pre>
  
  <p><code>Upper_party:</code>After making it uppercase, I want to view all the columns and not only columns that get change to upper case.</p>
  
  <p><code>Trim_party:</code>did some research and found out, to trim all columns I will have to write an UDF. I can do <code>Trim_party = FOREACH Upper_party GENERATE TRIM(col1)...TRIM(coln);</code> but I feel this is not an efficient way and time-consuming. </p>
  
  <p>Is there any other way, I could make this script work without writing UDF for Trim? </p>
  
  <p>Thanks in advance. </p>