Advertisement
shamiul93

bangla parser

Feb 12th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.09 KB | None | 0 0
  1. import java.io.*;
  2.  
  3.  
  4.  
  5.  
  6. public class Main {
  7.  
  8.  
  9.     public String sqlQueryGenereator(String arr[]){
  10.         String sql = "INSERT INTO `PROJECT`(`PROJECT_ID`, `PROJECT_NAME`, " +
  11.                 "`PROJECT_PURPOSE`, `PROJECT_DESC`, `APPROV_STATUS`, `YEAR`, " +
  12.                 "`FISCAL_YEAR`, `DIVISION_ID`, `DISTRICT_ID`, `CONSTITUENCY_ID`, " +
  13.                 "`SUB_DISTRICT_ID`, `TOTAL_ALLOCATION`, `MINISTRY_ID`, `SECTOR_ID`," +
  14.                 " `IMPL_ORG_ID`, `START_DATE`, `END_DATE`, `GOB`) VALUES ("+arr[0]+"," +
  15.                 arr[1]+","+arr[2]+","+arr[3]+","+arr[4]+","+arr[5]+","+arr[6]+","+arr[7]+"," +
  16.                 arr[8]+","+arr[9]+","+arr[10]+","+arr[11]+","+arr[12]+","+arr[13]+","+arr[14]+"," +
  17.                 arr[15]+","+arr[16]+","+arr[17]+")";
  18.         return sql;
  19.     }
  20.  
  21.  
  22.     public static void main(String[] args) throws IOException {
  23.         File inputFile = new File("t.txt");
  24.         File outputFile = new File("op.txt");
  25.  
  26.         BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(inputFile), "UTF8"));
  27.         String str;
  28.  
  29.         Writer out = null;
  30.  
  31.         try {
  32.             out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF8"));
  33.         } catch (UnsupportedEncodingException | FileNotFoundException e) {
  34.             e.printStackTrace();
  35.         }
  36.  
  37.         while ((str = in.readLine()) != null) {
  38. //            System.out.println(str);
  39. //            String s = "আমি খাপ";
  40.             if(str.equals("টাইপ - ১ ")){
  41.                 System.out.println("yes");
  42.                 System.out.println(str);
  43.             }
  44.             else {
  45. //                System.out.println("no");
  46.                 int index = str.indexOf("= ") ;
  47.                 index += 2;
  48.                 String tt = str.substring(index);
  49.                 System.out.println(tt);
  50.             }
  51. //            System.out.println(s);
  52.             out.append(str).append("\r\n");
  53.         }
  54.  
  55.         out.flush();
  56.         in.close();
  57.         // out.append(build).append("\r\n");
  58.         out.close();
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement