import se.todos.ecode.*; import java.io.*; import java.util.*; import java.util.regex.*; public class Main { public static void main(String[] args) throws Exception{ String sourceFileName = "d:\\devspace\\users.csv"; BufferedReader sourceFile = new BufferedReader (new FileReader(sourceFileName)); String resultFileName = "d:\\devspace\\users_result.txt"; BufferedWriter resultFile = new BufferedWriter (new FileWriter(resultFileName, true)); // ??? ???????? ? ???? String line = ""; String userID = ""; String splitter = ";"; String[] status = {" - OK", " - not find", " - deleting error"}; try{ resultFile.write(new Date().toString());//?????? ? ??????? ????? resultFile.newLine(); while ((line = sourceFile.readLine()) != null) { userID = line.split(splitter)[0]; if (Pattern.matches("[0-9]+", userID)){ //TODO ????? ???????, ???????? ?????????? ?????????? // API - ErrorCodeText ???????? ? ???, ???? ??????? //DeactivateUser - ? //BlockUser - ? resultFile.write(userID + status[0]); resultFile.newLine(); }else{ System.out.println(userID + " - ??? ?? ID ????????????"); } } }catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { sourceFile.close(); resultFile.close(); } catch (IOException e) { e.printStackTrace(); } } System.out.println("Done"); } }