Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
412 views
in Technique[技术] by (71.8m points)

java - 如何从文件读取,处理信息然后显示在新文件中?(How to read from file ,process the information and then display in a new file?)

I'm just learning java and I have to do a payroll System.

(我只是在学习Java,所以必须做一个薪资系统。)

I'm using the GUI and right now I'm struggling in reading from a text file(for example the employee`s details like name , job title,annual salary) ,then process the salary for each month and after that generate the payslip in a new file where I should have his details and the salary for a specific month.

(我正在使用GUI,现在我正努力读取文本文件(例如,员工的详细信息,例如姓名,职位,年薪),然后处理每个月的薪水,然后生成工资单在一个新文件中,我应该提供他的详细信息和特定月份的薪水。)

I have tried to read with bufferedreader but that's where I stop.

(我试图用bufferedreader进行阅读,但这就是我停止的地方。)

Any idea would be great.

(任何想法都很棒。)

  ask by Andreea Nistor translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
 File f = new File("C:\Users\User\Documents\NetBeansProjects\oop\alle\Emplyeeregister.txt");
    try {
        FileReader fr = new FileReader(f);
        BufferedReader br = new BufferedReader(fr);

       }
   } catch (FileNotFoundException ex) {
        Logger.getLogger(payslip.class.getName()).log(Level.SEVERE, null, ex);
    }
}          

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...