-1

このデータを含むテキスト ファイルがあります。

<Equity Chart>
2004-01-21 00:00,100000.00
2004-02-21 00:00,-9950.00
2004-03-20 00:00,-4250.00


<Summary Table>
Net Profit=-$101,100.00
Total Trades=2
Wins=0
Losses=2
Aborted Entries=0
Fatal Errors=0
Win Rate=0.00%
Max Draw Down=-$104,250.00
Gross Profit=$0.00
Gross Loss=-$101,100.00
Profit Factor=0.0
Max Consecutive Wins=0
Max Consecutive Losses=2
Peak Risk=$inf
Average Risk=$inf
Return On Avg. Risk=0.00%
Average Win Size=N/A
Average Loss Size=-$50,550.00
Avg. Win: Avg. Loss=N/A
Largest Win=N/A
Largest Loss=-$93,650.00
Max DIT=2
Min DIT=2
Average DIT=2.0


<Table Of Trades>
"Expiration","Entry Date","Exit Date","DIT","PnL","Peak Risk","Return on Risk","Opening Balance","Closing Balance","Starting IV","Ending IV","IV Change","IV Change Pct.","Starting UL Price","Ending UL Price","Price Movement","Price Movement STDEV","Adjustments"
"21-Feb-04","02-Feb-04","03-Feb-04","2","-$93,650.00","$inf","-0.00%","$100,000.00","-$9,950.00","0.14","0.15","0.0","1.64%","$1,135.26","$1,136.79","$1.53","0.13","13"
"20-Mar-04","01-Mar-04","02-Mar-04","2","-$7,450.00","$inf","-0.00%","$6,350.00","-$4,250.00","0.12","0.12","-0.0","-3.19%","$1,155.97","$1,156.26","$0.29","0.03","2"   

各グループを別々に印刷したいのですが、

System.out.print(<Equity Chart>);
output: 2004-01-21 00:00,100000.00
       2004-02-21 00:00,-9950.00
       2004-03-20 00:00,-4250.00

(Summary Table) と (Table Of Trades) も同様です。どうすればそれを達成できますか?

これは私が作成したコードです。

File newFile = new File(outputFolder + File.separator + fileName+".txt");
Scanner scan = new Scanner(newFile);
while (scan.hasNextLine()) {
    String line = scan.nextLine();      
    System.out.println(line);
}
4

1 に答える 1