Question: In Java, how would you parse useful information from a text file. This is the guidlines: Lines in /etc/passwd have the following format, with fields

In Java, how would you parse useful information from a text file. This is the guidlines:

"Lines in /etc/passwd have the following format, with fields separated by colons: account:encrypted password data:uid:gid:GCOS-field:homedir:shell

For example, this line represents the account for Tyler Jones. The salt is "

I need to be able to have the user name in a seperate string, and the salt/password. A normal example looks like this:

"michael:atbWfKL4etk4U:500:500:Michael Ferris:/home/michael:/bin/bash" 

I need the information before the first :, then I need the 2nd piece of info for compare. The last thing I need is the name of the user (example here is Michael Ferris).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!