import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;

/*
Convert the standard tab-separated file into the format:
node1 node2 cost
node2 node3 cost
....
[separated by space]
notice: default cost is 1.0
*/
public class TSVprocessor {
	public static void main(String args[]) {
		try {
			File file = new File("input.txt");
			file.createNewFile();
			FileWriter writer = new FileWriter(file);
			FileInputStream fstream = new FileInputStream(args[0]);
			DataInputStream in = new DataInputStream(fstream);
			BufferedReader br = new BufferedReader(new InputStreamReader(in));
			String strLine = null;
			while ((strLine = br.readLine()) != null) {
				if (!strLine.startsWith("#")) {
					String[] token = strLine.split("	");
					writer.write(token[0] + " " + token[1] + " 1.0" + "\n");
				}
			}
			in.close();
			writer.flush();
			writer.close();
		} catch (Exception e) {
			System.err.println("Error: " + e.getMessage());
		}
	}
}

@@ -318,16 +318,59 @@
 t is 1.0
+%0A%0Apass the input file as the first argument
 %0A*/%0Apubl
@@ -468,18 +468,19 @@
 w File(%22
-in
+out
 put.txt%22

Update convert.java