Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Solution {
- public static final List<Person> PEOPLE = new ArrayList<Person>();
- public static void main(String[] args) throws IOException, ParseException
- {
- BufferedReader br = new BufferedReader(new FileReader(args[0]));
- String line;
- SimpleDateFormat format = new SimpleDateFormat("dd mm yyyy");
- while((line = br.readLine()) != null) {
- String string = line.replaceAll("[a-zA-Zа-яА-Я]+", "").trim();
- Date date = format.parse(string);
- String name = line.replaceAll("[\\d]+", "");
- PEOPLE.add(new Person(name, date));
- }
- for (int i = 0; i < PEOPLE.size(); i++)
- {
- System.out.println(PEOPLE.get(i).getName() + " " + format.format(PEOPLE.get(i).getBirthday()));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement