title: How to read csv file into a 2-D array in map reduce
body: <pre><code>public class samReducer extends Reducer&lt;Text, callingFunction, Text, Text&gt; {
      protected void reduce(Text key, Iterable&lt;callingFunction&gt; values, Context context)
              throws IOException, InterruptedException {
          // TODO Auto-generated method stub
          Iterator&lt;callingFunction&gt; iterator = values.iterator();
          String toPass = "";
          int i = 0;
          String tmp[] = new String[300];
          //String temp = "";
          while(iterator.hasNext())
          {
               /*toPass = iterator.next().toString()+ " ";
              context.write(key , new Text((toPass)));*/
              tmp[i++] = iterator.next().toString();
              //i++;
          }
          for(i=0; i&lt;300; i++)
              context.write(key, new Text(tmp[i]));
      }
  }
  </code></pre>
  
  <p>I want to use it for back propagation algorithm in map reduce.</p>