title: error: overloaded method value write with alternatives:
body: <p>I am trying to read a fixed width file and writting it as text file ,below is the code . Input file layout length of the fields(4,10,3,5,3,1,1,5,7)</p>
  
  <p>094482018-07-10   022  14012     000       0        30000A   002290{</p>
  
  <p>059412018-07-10   022  14013     000       0        30000A   002290{</p>
  
  <p>015172018-07-10   046  17502     000       0        30000A   001699I</p>
  
  <pre><code>scala&gt; val inputdata = scala.io.Source.fromFile("/C:/Users/rrrrrr/Desktop/datas
  tage/inputdata.txt")
  inputdata: scala.io.BufferedSource = non-empty iterator
  
  scala&gt; val lines = inputdata.getLines
  lines: Iterator[String] = non-empty iterator
  
  scala&gt; val matched=lines.map(l=&gt;(l.substring(0,5).trim(),l.substring(5,5).trim()
  ))
  matched: Iterator[(String, String)] = non-empty iterator
  
  scala&gt; val outputdata= new File("/C:/Users/rkumar0/Desktop/folder/output_N4.txt"
  )
  outputdata: java.io.File = C:\Users\rrrrrrr\Desktop\folder\output_N4.txt
  
  scala&gt; val writer= new BufferedWriter(new FileWriter(outputdata))
  writer: java.io.BufferedWriter = java.io.BufferedWriter@759c0c14
  
  scala&gt; matched.foreach{line =&gt;
       | writer.write(line)
       | writer.newLine()
       | }
  &lt;console&gt;:19: error: overloaded method value write with alternatives:
    (x$1: Int)Unit &lt;and&gt;
    (x$1: String)Unit &lt;and&gt;
    (x$1: Array[Char])Unit
   cannot be applied to ((String, String))
         writer.write(line)
                ^
  
  scala&gt;
  </code></pre>
  
  <p>and my output file created empty.</p>