Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.99 KB | None | 0 0
  1. import com.google.zxing.BarcodeFormat;
  2. import com.google.zxing.Writer;
  3. import com.google.zxing.WriterException;
  4. import com.google.zxing.client.j2se.MatrixToImageWriter;
  5. import com.google.zxing.common.BitMatrix;
  6. import com.google.zxing.oned.Code128Writer;
  7. import com.google.zxing.pdf417.encoder.PDF417Writer;
  8. import com.google.zxing.qrcode.QRCodeWriter;
  9.  
  10. import java.awt.Graphics;
  11. import java.awt.Image;
  12. import java.awt.image.BufferedImage;
  13. import java.io.File;
  14. import java.io.FileNotFoundException;
  15. import java.io.FileOutputStream;
  16. import java.io.FileReader;
  17. import java.io.IOException;
  18. //import java.io.FileWriter;
  19. //import java.io.IOException;
  20. import java.util.Scanner;
  21.  
  22. import javax.imageio.ImageIO;
  23. import javax.swing.ImageIcon;
  24.  
  25. import java.util.ArrayList;
  26. import java.util.Arrays;
  27.  
  28.  
  29. public class Mich {
  30.  
  31. public static void main(String[] args) {
  32. // TODO Auto-generated method stub
  33.  
  34. String CR = Character.toString ((char) 13);
  35. String LF = Character.toString ((char) 10);
  36. String FS = Character.toString ((char) 28);
  37. String RS = Character.toString ((char) 30);
  38. String SP = Character.toString ((char) 32);
  39.  
  40.  
  41.  
  42. String MI = "@"+LF+RS+CR+"ANSI 636032030002DL00410220ZM02610027DLDCA"+LF+
  43. "DCB"+LF+"DCD"+LF+"DBA04212017"+LF+"DCSSHAFOU"+LF+"DCTNATHANIELJAMES"+
  44. LF+"DBD12032013"+LF+"DBB04211994"+LF+"DBC1"+LF+"DAY"+LF+"DAU"+LF+
  45. "DAG27901 MANHATTAN ST"+LF+"DAIST CLAIR SHORES"+LF+"DAJMI"+LF+"DAK480813516"+
  46. LF+"DAQS 100 622 367 308"+"DCF"+LF+"DCG"+LF+"DCH"+LF+"DAH"+LF+"DCKS100622367308199604212017"+
  47. LF+LF;
  48.  
  49. String CO2 = "@"+LF+RS+CR+"ANSI 636020070002DL00410223ZC02640014DLDAQ040900832"+LF+
  50. "DCSDOWDELL"+LF+"DDEU"+LF+"DACCHELSEA"+LF+"DDFU"+LF+"DADANN"+LF+
  51. "DDGU"+LF+"DCAR"+LF+"DCBNONE"+LF+"DCDNONE"+LF+"DBD05122015"+LF+
  52. "DBB07281988"+LF+"DBA07282020"+LF+"DBC2"+LF+"DAU064 in"+LF+"DAYBLU"+
  53. LF+"DAG1755 DAYTON STREET"+LF+"DAIAURORA"+LF+"DAJCO"+LF+"DAK800100000"+
  54. LF+"DCFNONE"+LF+"DCGUSA"+LF+"DDAM"+LF+"DDB06012013"+CR+"ZCZCA"+LF+
  55. "ZCB"+LF+"ZCC"+CR;
  56.  
  57. //+CR+LF+RS+CR+LF+
  58. String CO = "@"+CR+LF+RS+CR+LF+"ANSI 636020070002DL00410223ZC02640014DLDAQ040900832"+CR+LF+
  59. "DCSDOWDELL"+CR+LF+"DDEU"+CR+LF+"DACCHELSEA"+CR+LF+"DDFU"+CR+LF+"DADANN"+CR+LF+"DDGU"+CR+LF+
  60. "DCAR"+CR+LF+"DCBNONE"+CR+LF+"DCDNONE"+CR+LF+"DBD05122015"+CR+LF+"DBB07281988"+CR+LF+"DBA07282020"
  61. +CR+LF+"DBC2"+CR+LF+"DAU064 in"+CR+LF+"DAYBLU"+CR+LF+"DAG1755 DAYTON STREET"+CR+LF+"DAIAURORA"+CR+LF+
  62. "DAJCO"+CR+LF+"DAK800100000"+CR+LF+"DCFNONE"+CR+LF+"DCGUSA"+CR+LF+"DDAM"+CR+LF+"DDB06012013"
  63. +CR+LF+"ZCZCA"+CR+LF+"ZCB"+CR+LF+"ZCC";
  64.  
  65. String ED = "@"+LF+RS+CR+"ANSI 536020050002DL00415223ZC02640014DLDAQ42069000"+LF+
  66. "DCSLAST"+LF+"DDEU"+LF+"DACFIRST"+LF+"DDFU"+LF+"DADM"+LF+
  67. "DDGU"+LF+"DCAR"+LF+"DCBNONE"+LF+"DCDNONE"+LF+"DBD05122015"+LF+
  68. "DBB07281988"+LF+"DBA07282020"+LF+"DBC1"+LF+"DAU064 in"+LF+"DAYBLU"+
  69. LF+"DAG1738 FETTY WAP WAY"+LF+"DAIREDDIT"+LF+"DAJED"+LF+"DAK123450000"+
  70. LF+"DCFNONE"+LF+"DCGUSA"+LF+"DDAM"+LF+"DDB06012013"+CR+"ZEZFU"+LF+
  71. "ZCB"+LF+"ZCC"+CR;
  72.  
  73. String ME = "@"+LF+RS+CR+"ANSI 636041040002DL00410242ZM02830007DLDAQ8250093"+CR+LF+"DCSTREFRY"
  74. +CR+LF+"DDEN"+CR+LF+"DACALFRED"+CR+LF+"DDFN"+CR+LF+"DADWILSON"+CR+LF+"DDGN"+CR+LF+
  75. "DCAA"+CR+LF+"DCBNONE"+CR+LF+"DCDIN"+CR+LF+"DBD03062013"+CR+LF+"DBB01291959"+CR+LF+
  76. "DBA01292018"+CR+LF+"DBC1"+CR+LF+"DAU071 in"+CR+LF+"DAYGR"+CR+LF+"DAG1102 ALFRED ROAD"
  77. +CR+LF+"DAIARUNDEL"+CR+LF+"DAJME"+CR+LF+"DAK040460000"+CR+LF+"DCFNONE"+CR+LF+"DCGUSA"
  78. +CR+LF+"DCUIV"+CR+LF+"DAW270"+CR+LF+"DAZGY"+CR+LF+"DCKF1307182500930301"+CR+LF+"ZMZMAN";
  79.  
  80. String OR = "@"+LF+RS+CR+"ANSI 6360290102DL00390182ZO02210031DLDAQ4305455"+CR+LF+"DAAHUMBERT, RYAN MATTHEW"
  81. +CR+LF+"DAG"+CR+LF+"DAL4894 HENCEFORTH LN"+CR+LF+"DAIEUGENE"+CR+LF+"DAJOR"+CR+LF+"DAK97402"+CR+LF+
  82. "DARC"+CR+LF+"DASD"+CR+LF+"DAT"+CR+LF+"DAU509"+CR+LF+"DAW175"+CR+LF+"DBA20221024"+CR+LF+"DBB19941024"
  83. +CR+LF+"DBC1"+CR+LF+"DBD20140404"+CR+LF+"ZOZOAFIRST LICENSED 04-04-2014"+CR+LF;
  84.  
  85. String SC = "@"+LF+FS+CR+"ANSI 6360050101DL00300195DLDAQ934870146"+LF+
  86. "DAASMTIH,JOHN,J,"+LF+"DAG111 1ST STREET"+LF+"DAISPRINGFIELD"+LF+
  87. "DAJSC"+LF+"DAK72564 9654 "+LF+"DAR "+LF+"DAS "+LF+"DAT "+
  88. LF+"DAU073 IN"+LF+"DAW130"+LF+"DAY"+LF+"DAZBRO"+LF+"DBA02192018"+
  89. LF+"DBB02191996"+LF+"DBC1"+LF+"DBD02242014"+LF+"DBG"+CR+"DDEU"+CR;
  90.  
  91.  
  92.  
  93. //barcodeGen(MI,"MI_test");
  94.  
  95. //barcodeGen(ME,"ME_test");
  96.  
  97. //barcodeGen(OR,"OR_test");
  98.  
  99. //barcodeGen(CO2, "CO2_test");
  100.  
  101. //barcodeGen(ED, "ED_test");
  102.  
  103.  
  104.  
  105.  
  106.  
  107. //barcodeGen(MI, "MI_test");
  108. // TODO Auto-generated method stub
  109. ArrayList<String> filenames = new ArrayList<String>();
  110.  
  111. //get filenames
  112. File directory = new File("./csvs");
  113. //get all the files from a directory
  114. File[] fList = directory.listFiles();
  115. for (File file : fList){
  116. if (file.isFile()){
  117. filenames.add(file.getName());
  118. }
  119. }
  120.  
  121. for(int n=0; n<filenames.size(); n++){
  122. System.out.println(filenames.get(n));
  123. }
  124.  
  125. //cycle through filenames
  126. for(int b=1; b<filenames.size(); b++){
  127. String name="./csvs/"+filenames.get(b);
  128.  
  129. //pam is a huge bitch
  130.  
  131. String filename = name;
  132.  
  133. //ArrayList<String> template = textToArr("blank.txt");
  134. ArrayList<String> lines = getLines(filename);
  135. ArrayList<String> csv = readCSV(filename);
  136. //ArrayList<String> header = getHeader(csv);
  137.  
  138.  
  139.  
  140. //print line by line
  141. for(int i=0; i<lines.size(); i++){
  142. System.out.println(i+":"+lines.get(i));
  143. }
  144. System.out.println("\n");
  145.  
  146.  
  147. //separated values
  148. for(int s=1; s<lines.size();s++){
  149. //template = textToArr("blank.txt");
  150. ArrayList<String> separated = splitByComma(lines.get(s));
  151. csv=separated;
  152.  
  153.  
  154. System.out.println("\n"+s+" Separated: \n");
  155. for(int i=0; i<csv.size(); i++){
  156. System.out.println(i+":"+csv.get(i));
  157. }
  158.  
  159. System.out.println("\n");
  160.  
  161. String data = "";
  162. String oneddata = "";
  163. String onedoutputName = "";
  164.  
  165. //IF STATE == STATE THEN.... fuck it ill add it later
  166. if(csv.get(0).equals("MI")){
  167. data = MIdataCreator(csv, MI);
  168. oneddata = oneddatacreator(csv);
  169. //onedoutputName = csv.get(4)+"_"+oneddata+"_"+csv.get(8);
  170. onedoutputName = csv.get(4)+"_"+oneddata;
  171. }
  172. else if(csv.get(0).equals("SC"))
  173. data = OTCdataCreator(csv, SC);
  174.  
  175. //data = MIdataCreator(csv, MI);
  176.  
  177.  
  178.  
  179. System.out.println("\n\n");
  180.  
  181. System.out.println("Data:");
  182.  
  183.  
  184. System.out.println(data);
  185.  
  186. String outputName = "";
  187. if(csv.get(0).equals("MI")){
  188. outputName = "PDF417"+"_"+csv.get(4);
  189. }
  190. else if(csv.get(0).equals("SC")){
  191. outputName = "PDF417"+"_"+csv.get(4);
  192. }
  193. barcodeGen(data, outputName);
  194. onedbarcodeGen(oneddata,onedoutputName);
  195.  
  196. System.out.println("End of loop\n -------");
  197.  
  198. }
  199. }
  200.  
  201. //image cropping begin
  202. System.out.println("Begin cropping images...");
  203. ArrayList<String> filenames2 = new ArrayList<String>();
  204.  
  205. //get filenames2
  206. File directory2 = new File("./Images");
  207. //get all the files from a directory2
  208. File[] fList2 = directory2.listFiles();
  209. for (File file : fList2){
  210. if (file.isFile()){
  211. filenames2.add(file.getName());
  212. }
  213. }
  214. //for(int i=0; i<filenames2.size(); i++){
  215. // System.out.println(filenames2.get(i));
  216. // }
  217.  
  218.  
  219. //cycle through filenames2
  220. for(int i=1; i<filenames2.size(); i++){
  221. //System.out.println(i);
  222. Image img = new ImageIcon("./Images/"+filenames2.get(i)).getImage();
  223.  
  224. BufferedImage bufferedImage = new BufferedImage(img.getWidth(null), img.getHeight(null),
  225. BufferedImage.TYPE_INT_RGB);
  226.  
  227. Graphics g = bufferedImage.createGraphics();
  228. g.drawImage(img, 0, 0, null);
  229. g.dispose();
  230.  
  231. bufferedImage = getCroppedImage(bufferedImage, .4);
  232.  
  233.  
  234. try {
  235. ImageIO.write(bufferedImage, "png", new File("./Output/"+filenames2.get(i)));
  236. } catch (IOException e) {
  237. // TODO Auto-generated catch block
  238. e.printStackTrace();
  239. }
  240.  
  241.  
  242. }
  243.  
  244. System.out.println("Exiting!");
  245. }
  246.  
  247.  
  248. //make 1D info
  249. public static String oneddatacreator(ArrayList<String> info){
  250. String data=null;
  251. /*
  252. 1) drivers license number
  253. 2) year of birth (1994)
  254. 3) month of birth (08)
  255. 4) day of birth (30)
  256. 5) last two digits of expiration year, so 2019 would be (19)
  257. 6) expiration month (08)
  258. 7) generic "01" that appears at the end of each persons. Idk why but it's always there
  259. */
  260. String bd = info.get(8);
  261. String[] result = bd.split("(?!^)");
  262. String month = result[0]+result[1];
  263. String day = result[2]+result[3];
  264. String year = result[4]+result[5]+result[6]+result[7];
  265.  
  266. String exp = info.get(10);
  267. String[] expiry = exp.split("(?!^)");
  268. String expYear = expiry[6]+expiry[7];
  269. String expMonth = expiry[0]+expiry[1];
  270.  
  271. String dlno = info.get(1);
  272. String dlnum = dlno.replaceAll(" ", "");
  273.  
  274.  
  275. data = dlnum + year + month + day + expYear + expMonth + "01";
  276.  
  277.  
  278.  
  279. return data;
  280. }
  281.  
  282. public static void onedbarcodeGen(String dada, String fn){
  283. BitMatrix bitMatrix;
  284. //Writer writer = new QRCodeWriter();
  285. try {
  286. // Write Barcode
  287. bitMatrix = new Code128Writer().encode(dada, BarcodeFormat.CODE_128, 150, 80, null);
  288. //MatrixToImageWriter.writeToStream(bitMatrix, "png", new FileOutputStream(new File("./1D/"+fn+"_"+dada+".png")));
  289. MatrixToImageWriter.writeToStream(bitMatrix, "png", new FileOutputStream(new File("./1D/"+fn+".png")));
  290. System.out.println("Code128 Barcode Generated: " +fn);
  291.  
  292. } catch (Exception e) {
  293. System.out.println("Exception Found." + e.getMessage());
  294. }
  295. }
  296.  
  297. public static void barcodeGen(String data, String filename){
  298. BitMatrix bitMatrix;
  299. Writer writer = new PDF417Writer();
  300. try {
  301. writer = new PDF417Writer();
  302. bitMatrix = writer.encode(data, BarcodeFormat.PDF_417, 80, 150);
  303. MatrixToImageWriter.writeToStream(bitMatrix, "png", new FileOutputStream(new File("./Images/"+ filename +".png")));
  304. System.out.println("PDF417 Code Generated: " + filename + ".png");
  305. }
  306. catch (Exception e) {
  307. System.out.println("Exception Found." + e.getMessage());
  308. }
  309. }
  310.  
  311. public static ArrayList<String> splitByComma(String s){
  312. String[] items = s.split(",");
  313. ArrayList<String> itemList = new ArrayList<String>(Arrays.asList(items));
  314.  
  315. System.out.println(itemList);
  316. return itemList;
  317. }
  318.  
  319. public static ArrayList<String> textToArr(String txtName){
  320. ArrayList<String> template = new ArrayList<String>();
  321.  
  322. try {
  323. Scanner in = new Scanner(new FileReader(txtName));
  324. while (in.hasNext()) {
  325. template.add(in.nextLine());
  326. }
  327. in.close();
  328. }
  329. catch (FileNotFoundException f){
  330. System.err.println("Could not open the file: " + txtName);
  331. }
  332.  
  333. return template;
  334. }
  335.  
  336. public static ArrayList<String> getLines(String csv){
  337. ArrayList<String> csvLines = new ArrayList<String>();
  338. Scanner scanner;
  339. try {
  340. scanner = new Scanner(new File(csv));
  341. while (scanner.hasNextLine())
  342. {
  343. csvLines.add(scanner.nextLine().toUpperCase());
  344. }
  345. }
  346. catch (FileNotFoundException e) {
  347. // TODO Auto-generated catch block
  348. e.printStackTrace();
  349. }
  350.  
  351.  
  352. return csvLines;
  353. }
  354.  
  355. public static ArrayList<String> readCSV(String csvName){
  356. ArrayList<String> csv = new ArrayList<String>();
  357. //Get scanner instance
  358. Scanner scanner;
  359. try {
  360. scanner = new Scanner(new File(csvName));
  361. scanner.useDelimiter(",");
  362. while (scanner.hasNext())
  363. {
  364. csv.add(scanner.next().toUpperCase());
  365. }
  366.  
  367.  
  368. scanner.close();
  369. }
  370. catch (FileNotFoundException e) {
  371. // TODO Auto-generated catch block
  372. e.printStackTrace();
  373. }
  374.  
  375.  
  376.  
  377. return csv;
  378. }
  379. public static ArrayList<String> getHeader(ArrayList<String> csv){
  380. ArrayList<String> header = new ArrayList<String>();
  381. for(int i=0; i<28; i++){
  382. header.add(csv.get(0));
  383. }
  384.  
  385. return header;
  386. }
  387.  
  388.  
  389. public static BufferedImage getCroppedImage(BufferedImage source, double tolerance) {
  390. // Get our top-left pixel color as our "baseline" for cropping
  391. int baseColor = source.getRGB(0, 0);
  392.  
  393. int width = source.getWidth();
  394. int height = source.getHeight();
  395.  
  396. int topY = Integer.MAX_VALUE, topX = Integer.MAX_VALUE;
  397. int bottomY = -1, bottomX = -1;
  398. for(int y=0; y<height; y++) {
  399. for(int x=0; x<width; x++) {
  400. if (colorWithinTolerance(baseColor, source.getRGB(x, y), tolerance)) {
  401. if (x < topX) topX = x;
  402. if (y < topY) topY = y;
  403. if (x > bottomX) bottomX = x;
  404. if (y > bottomY) bottomY = y;
  405. }
  406. }
  407. }
  408.  
  409. BufferedImage destination = new BufferedImage( (bottomX-topX+1),
  410. (bottomY-topY+1), BufferedImage.TYPE_INT_ARGB);
  411.  
  412. destination.getGraphics().drawImage(source, 0, 0,
  413. destination.getWidth(), destination.getHeight(),
  414. topX, topY, bottomX, bottomY, null);
  415.  
  416. return destination;
  417. }
  418.  
  419. private static boolean colorWithinTolerance(int a, int b, double tolerance) {
  420. int aAlpha = (int)((a & 0xFF000000) >>> 24); // Alpha level
  421. int aRed = (int)((a & 0x00FF0000) >>> 16); // Red level
  422. int aGreen = (int)((a & 0x0000FF00) >>> 8); // Green level
  423. int aBlue = (int)(a & 0x000000FF); // Blue level
  424.  
  425. int bAlpha = (int)((b & 0xFF000000) >>> 24); // Alpha level
  426. int bRed = (int)((b & 0x00FF0000) >>> 16); // Red level
  427. int bGreen = (int)((b & 0x0000FF00) >>> 8); // Green level
  428. int bBlue = (int)(b & 0x000000FF); // Blue level
  429.  
  430. double distance = Math.sqrt((aAlpha-bAlpha)*(aAlpha-bAlpha) +
  431. (aRed-bRed)*(aRed-bRed) +
  432. (aGreen-bGreen)*(aGreen-bGreen) +
  433. (aBlue-bBlue)*(aBlue-bBlue));
  434.  
  435. // 510.0 is the maximum distance between two colors
  436. // (0,0,0,0 -> 255,255,255,255)
  437. double percentAway = distance / 510.0d;
  438.  
  439. return (percentAway > tolerance);
  440. }
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447. public static String MIdataCreator(ArrayList<String> info, String temp){
  448. /*
  449. //ziipcode
  450. String zipcode = info.get(2);
  451. zipcode = zipcode.replace("MI ", "");
  452. zipcode = zipcode.replace("-", " ");
  453. info.set(2, zipcode);
  454.  
  455. //sex bullshit
  456. String sex="";
  457. if(info.get(14).equals("M")){
  458. sex="1";
  459. }
  460. else if(info.get(14).equals("F")){
  461. sex="2";
  462. }
  463.  
  464. //heigh bullshit
  465. String height=info.get(10);
  466. char feet = height.charAt(0);
  467. char inch1 = height.charAt(1);
  468. char inch2 = height.charAt(2);
  469.  
  470. String feetString = new StringBuilder().append(feet).toString();
  471. String inches = new StringBuilder().append(inch1).append(inch2).toString();
  472. int f = Integer.parseInt(feetString);
  473. int i = Integer.parseInt(inches);
  474. f=f*12;
  475. int heightTotal = f+i;
  476.  
  477. //name shit
  478. String s = info.get(8);
  479. String[] names = s.split(" ");
  480.  
  481. //date shit
  482. String bd = info.get(5);
  483. String[] bday = bd.split("-");
  484. bday[2] = "19"+bday[2];
  485. String fullBirthday = bday[0]+bday[1]+bday[2];
  486.  
  487. String issue = info.get(12);
  488. String[] iss = issue.split("-");
  489. iss[2] = "20"+iss[2];
  490. String fullIssue = iss[0]+iss[1]+iss[2];
  491.  
  492. String expiry = info.get(6);
  493. String[] exp = expiry.split("-");
  494. String fullExpire = exp[0]+exp[1]+exp[2];
  495.  
  496. String city = info.get(1);
  497. city = city.replaceAll("\\\\","");
  498. System.out.println("CITY: " + city);
  499. */
  500.  
  501. String t=temp;
  502. t=t.replace("DAQS 100 622 367 308", "DAQ"+info.get(1));
  503. t=t.replace("DCSSHAFOU", "DCS"+info.get(4));
  504. t=t.replace("DCTNATHANIELJAMES", "DCT"+info.get(2)+" "+info.get(3));
  505. t=t.replace("DBB04211994", "DBB"+info.get(8));
  506. t=t.replace("DBA04212017", "DBA"+info.get(10));
  507. t=t.replace("DBD12032013", "DBD"+info.get(9));
  508. t=t.replace("DBC1", "DBC"+info.get(15));
  509. //t=t.replace("DAU073 IN", "DAU"+"0"+heightTotal+" IN");
  510. //t=t.replace("DAYBLU", "DAY"+info.get(7));
  511. t=t.replace("DAG27901 MANHATTAN ST", "DAG"+info.get(5));
  512. t=t.replace("DAIST CLAIR SHORES", "DAI"+info.get(6));
  513. t=t.replace("DAK480813516", "DAK"+info.get(7));
  514.  
  515.  
  516. return t;
  517. }
  518.  
  519. public static String OTCdataCreator(ArrayList<String> info, String temp){
  520. //remove all back slashes
  521. for(int i=0; i<info.size();i++){
  522. String s = info.get(i);
  523. s=s.replace("\\","");
  524. info.set(i, s);
  525. }
  526.  
  527. String t=temp;
  528. t=t.replace("DAQ934870146", "DAQ"+info.get(5));
  529. t=t.replace("DAASMTIH,JOHN,J,", "DAA"+info.get(6)+","+info.get(7)+","+info.get(8)+",");
  530. t=t.replace("DBB02191996", "DBB"+info.get(21));
  531. t=t.replace("DBD02242014", "DBD"+info.get(23));
  532. t=t.replace("DBA02192018", "DBA"+info.get(20));
  533. t=t.replace("DBC1", "DBC"+info.get(22));
  534. t=t.replace("DAU073 IN", "DAU"+info.get(16).toUpperCase());
  535. t=t.replace("DAG111 1ST STREET", "DAG"+info.get(9));
  536. String secondZIP = info.get(12).substring(5,9);
  537. String firstZIP = info.get(12).substring(0, 5);
  538. t=t.replace("DAK72564 9654", "DAK"+firstZIP+" "+secondZIP);
  539. t=t.replace("DAISPRINGFIELD", "DAI"+info.get(10));
  540.  
  541. //fuck
  542. return t;
  543. }
  544.  
  545. public static String SCdataCreator(ArrayList<String> info, String temp){
  546. //remove all back slashes
  547. for(int i=0; i<info.size();i++){
  548. String s = info.get(i);
  549. s=s.replace("\\","");
  550. info.set(i, s);
  551. }
  552.  
  553. String t=temp;
  554. t=t.replace("DAQ934870146", "DAQ"+info.get(1));
  555. t=t.replace("DAASMTIH,JOHN,J,", "DAA"+info.get(4)+","+info.get(2)+","+info.get(3)+",");
  556. t=t.replace("DBB02191996", "DBB"+info.get(8));
  557. t=t.replace("DBD02242014", "DBD"+info.get(9));
  558. t=t.replace("DBA02192018", "DBA"+info.get(10));
  559. t=t.replace("DBC1", "DBC"+info.get(15));
  560. t=t.replace("DAU073 IN", "DAU"+info.get(13).toUpperCase());
  561. t=t.replace("DAG111 1ST STREET", "DAG"+info.get(5));
  562. String secondZIP = info.get(7).substring(5,9);
  563. String firstZIP = info.get(7).substring(0, 5);
  564. t=t.replace("DAK72564 9654", "DAK"+firstZIP+" "+secondZIP);
  565. t=t.replace("DAISPRINGFIELD", "DAI"+info.get(6));
  566. t=t.replace("DAW130", "DAW"+info.get(14));
  567.  
  568.  
  569. //fuck
  570. return t;
  571. }
  572. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement