顯然,我們d不想做你的功課。但我們不想讓你們擱淺。
我已經打開了許多東西,下面只是一個Java看起來的僞代碼。你可以從這裏開始...
FileReader reader = ... // open the file reader using the input file
FileWriter writer = ...// open a file for writing output
while(the stream doesn't end) { // provide the condition, as must be
String line = ... // read a line from the reader
String character = line.substring(0, line.indexOf("\t")),
pronounciation = line.substring(character.length() -1).substring(line.indexOf("\t", character.length()),
definition = line.substring(line.lastIndexOf("\t")); // Obviously, this isn't accurate.... you need to work around this.
writeLineToFile(character)
writeLineToFile(pronounciation)
writeLineToFile(definition)
}
close the reader and writer
Stackoverflow是一個編程問題的答案的地方。這不是學習編程基礎的地方。 – jomsk1e
只是谷歌它:從文件讀取Java,寫文件等 – Tala
另外我不會選擇Java來完成這項任務。 Perl(或任何其他腳本語言)更適合於此。 – m0skit0