title: MapReduce: How can I output key/value pair without newlines?
body: <p>I am using a 0 reduce approach to my problem. I wish to preprocess data from one file and then to write it out as another file, but with no new lines and tab delimeters? How can I output my map job that has processed my data with the same file format it came in minus the preprocess.
  That is, I have something like this: </p>
  
  <p>Preprocess: </p>
  
  <pre><code>&lt;TITLE&gt; Herp derp &lt;/Title&gt; I am a major general  
  </code></pre>
  
  <p>Post Process: </p>
  
  <pre><code>Herp 
  Derp 
  I 
  am 
  a
  major
  general
  </code></pre>
  
  <p>What I want it to do is this: </p>
  
  <pre><code>Herp Derp I am a major general 
  </code></pre>
  
  <p>I believe the issue is with this line of code: </p>
  
  <pre><code>job.setOutputFormatClass(TextOutputFormat.class);
  </code></pre>
  
  <p>However, when I tried, quite naively to do something like: </p>
  
  <pre><code>job.setOutputFormatClass(null);
  </code></pre>
  
  <p>It obviously would not work. Is there an format class that is provided that I can use to do this? If not, how could I write my own class to just output everything as I want? I am new to hadoop and map reduce. </p>
  
  <p>I have included my map function below. I do not want to use reduce as it would sort between the map and reducer. </p>
  
  <pre><code>        public void map(LongWritable key, Text value, Context context)
                  throws IOException, InterruptedException {
  
              String line = value.toString();
              StringTokenizer tokenizer = new StringTokenizer(line);
  
  
              while (tokenizer.hasMoreTokens()) {
  
                  word.set(tokenizer.nextToken());
  
                  //Did preprocessing here, irrelevant to my problem
  
                  context.write(word, null);
              }
          }
  </code></pre>
  
  <p>Also, I have also googled this and read the apache hadoop api to see if I can gleam an answer. </p>