我有一个文本文件,其中包含以下文本:
VOLT=367
CURRENT=0.07
TEMP=031
RPM=3780
63HZ
VOLT=288
CURRENT=0.00
TEMP=030
RPM=3420
57HZ
等等....我想将此文本文件作为java中的输入并创建一个输出文本文件,此文本排列为:
367,0.07,031,3780,63
288,0.00,030,3420,57
以此类推,直到txt文件结束..
到目前为止的编码尝试:
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
try {
FileInputStream fstream = new FileInputStream("file path\data.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(fstream));
BufferedWriter brw = new BufferedWriter(new OutputStreamWriter(out));
do {
for (int i=1;i<50;i++) {
//I dont know what to do here
...