Skip to content

Instantly share code, notes, and snippets.

@amasho
Created October 2, 2014 07:54
Show Gist options
  • Select an option

  • Save amasho/75accf701e01535b5517 to your computer and use it in GitHub Desktop.

Select an option

Save amasho/75accf701e01535b5517 to your computer and use it in GitHub Desktop.
tupleの壊れたデータを除外抽出する
import scala.io.Source
import java.io.FileWriter
val file = "15_10.20.4."
(1 until 9).foreach(i => {
val fw = new FileWriter(file + s"${i.toString}-2.log");
Source.fromFile(file + s"${i.toString}.log").getLines().foreach(l =>
if(l.split("\t").size == 5){ fw.write(l + "\n") }
)
fw.close()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment