2

I'm trying to create a table like SQL style with AWT but this method only can show 1000 files of data. How I could show a large data of 4000 to 10000 lines in CSV?

This is an example of code that I tried without good performance:

def MH=  new File('vengggfdus2xvhg.csv').getText('UTF-8').split("\n").size()*12
def ML= new File('vengggfdus2xvhg.csv').getText('UTF-8').split("\n")[2].split(";").size() *140
def scale=MH*ML

  image3 = new BufferedImage(ML,MH, BufferedImage.TYPE_INT_ARGB);

    fgImage= ImageIO.read(new File("raya5.png"));
    fgImagev= ImageIO.read(new File("rayav5.png"));
      g = image3.getGraphics();
        g.setFont(g.getFont().deriveFont(12f));
    def xyh=0
    def xyh1=20
    String valz=""
    String valp=""

    stringInput= new File('vengggfdus2xvhg.csv').getText('UTF-8').replaceAll(/(.+\n)/){ xyh=0 ;g.drawImage(fgImagev, xyh+0,xyh1+20, null);valz="hh"  ;it[1].replaceAll(/([^;]+);/){ valp=it[1].replaceAll(/(.{22}).+/, '$1');g.drawString("${valp}", xyh,xyh1); g.setColor(Color.BLUE); g.drawImage(fgImage, xyh+0,xyh1-20, null);  xyh =xyh+140; valz}             ; xyh1=xyh1+18  ;        }

     println "scale"

    print "hiji2"
    g.dispose();   
    print "hiji"
      ImageIO.write(image3, "png", new File("pokemon1.png")); 
tim_yates
  • 167,322
  • 27
  • 342
  • 338
mightguy
  • 175
  • 1
  • 8

0 Answers0