Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to write cell after check another cell in another excel file?

rio111Jul 27 2016 — edited Jul 27 2016

i want to write on "Double Order" column after check the "Order ID" column wheter it's double value or not. i use apache poi. can someone help me?

public static void main(String[] args) throws IOException {

      

            FileInputStream file = new FileInputStream(new File(

                    "C:\\Users\\Ricky\\Desktop\\Double Booking1.xlsx"));

          

            XSSFWorkbook workbook = new XSSFWorkbook(file);

          XSSFSheet sheet = workbook.getSheetAt(0);

            Iterator<Row> rowIterator = sheet.iterator();

            while (rowIterator.hasNext()) {

                Row row = rowIterator.next();

               

                Iterator<Cell> cellIterator = row.cellIterator();

                while (cellIterator.hasNext()) {

                    Cell cell = cellIterator.next();

                    if(cell.getColumnIndex()==1) {

                       

                    }

                    System.out.print(cell.toString() + "  ");

                }

                System.out.println();

            }

    }


       

Customer IDOrder IDDouble Order
1004-1445880FU-002774
1004-1445880FU-002774
1004-1445880FU-002774
1004-1445880FU-002774
1004-1445880FU-002774
1004-1445880FU-002850
1004-1445880FU-002850
1004-1445880FU-002850
1004-1445880FU-002850
1004-1445880FU-002850

Comments

EJP
I'm inclined to agree with the Java 7 compiler here. Did you really mean to put S and T back to front in the specification of T?
955312
As name of the class says it's strange one...
It's just stupid example - more interesting is change of compiler behavior...
If it should not compile why is it compiling under java 6?
gimbal2
Answer
Because they're two separate things? Java 7 is NOT simply an "upgrade" from Java 6, its a new platform. Therefore things can and will be different.

Might in this case simply be that a bug in the compiler was plugged though.
Marked as Answer by 955312 · Sep 27 2020
955312
Thank you for answer.
1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 24 2016
Added on Jul 27 2016
2 comments
454 views