I am not able to get the file path

sayali jawale

I have created Script for Read data from excel file, but it gives me error like "C:\testdata.xls (The system cannot find the file specified)". Please Hple. This is my code.

 FileInputStream file = new FileInputStream(new File ("C:\\testdata.xls")); 
 HSSFWorkbook workbook = new HSSFWorkbook(file);
 HSSFSheet sheet = workbook.getSheetAt(0);
 String heading = sheet.getRow(0).getCell(0).getStringCellValue();
 String searchText1 = sheet.getRow(1).getCell(0).getStringCellValue();
 String searchText2 = sheet.getRow(2).getCell(0).getStringCellValue();
 System.out.println("Heading is:" + heading);
 System.out.println("Search Text 1 is:" + searchText1);
 System.out.println("Search Text 2 is:" + searchText2);
 file.close();
pr4bh4sh

You can verify if the path is correct or not by creating file as

new File ("C:\\testdata.xls")

Then print the absolute path. Check if it is a valid path.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

With doctrine I am not able to get the right sequence name for Postgres

From Dev

I am not able to get the value in textbox which i have posted in controller

From Dev

I am trying to get full path of upload control in jquery but not working

From Dev

Why am I not able to use relative path to open a file in CLion?

From Dev

I am not able to get the connection string for db file

From Dev

I want to Access enTranslations provided in one JS File as shown Below, But I am not Able to access it

From Dev

Why I am not able to see the JAVA_HOME path on my MAC OS X 10.11?

From Dev

Not able to get file name from same file path in two different activities

From Dev

I am able to add composite indexes to index.yaml file and get it to work without removing and reloading the data from datastore

From Dev

I am on Manjaro, and I am setting it up for JDBC, I have installed mariadb, mariadb-jdbc but I am not able to locate the /etc/my.conf file

From Dev

I am able to get Geo Points( Latitude and Longitude) but could't able to locate position on Map

From Dev

I am not able to get a field in my Django ManyToMany Relation

From Dev

I am not able to get facebook user from this query

From Dev

With doctrine I am not able to get the right sequence name for Postgres

From Dev

I am not able to install svnnotify

From Dev

Not Able to get the full path of the file

From Dev

Not able to get attribute value, am I missing something?

From Dev

I am trying to get full path of upload control in jquery but not working

From Dev

Why am I able to open this file?

From Dev

I am not able to get data from my localhost using this code. Please help me. I am getting nil

From Dev

I am trying to read a file and to show the reading progress in %. I have tried following code but I am not able to divide in chunks & show progress

From Dev

I am not able to create and store a zip file using php

From Dev

I am not able to build the job in jenkins,,,even I had given the path for github

From Dev

How come I, as a normal user, am able to change ownership of a file?

From Dev

Why am I able to still write to a file marked 400

From Dev

I am not able to get the currentActivity in unity,and i am getting the following error after the application is run in the device

From Dev

ClearCase: I am not able to get the files from Clearcase

From Dev

I am on Manjaro, and I am setting it up for JDBC, I have installed mariadb, mariadb-jdbc but I am not able to locate the /etc/my.conf file

From Dev

Why am I not able to get proper dates in my graph?

Related Related

  1. 1

    With doctrine I am not able to get the right sequence name for Postgres

  2. 2

    I am not able to get the value in textbox which i have posted in controller

  3. 3

    I am trying to get full path of upload control in jquery but not working

  4. 4

    Why am I not able to use relative path to open a file in CLion?

  5. 5

    I am not able to get the connection string for db file

  6. 6

    I want to Access enTranslations provided in one JS File as shown Below, But I am not Able to access it

  7. 7

    Why I am not able to see the JAVA_HOME path on my MAC OS X 10.11?

  8. 8

    Not able to get file name from same file path in two different activities

  9. 9

    I am able to add composite indexes to index.yaml file and get it to work without removing and reloading the data from datastore

  10. 10

    I am on Manjaro, and I am setting it up for JDBC, I have installed mariadb, mariadb-jdbc but I am not able to locate the /etc/my.conf file

  11. 11

    I am able to get Geo Points( Latitude and Longitude) but could't able to locate position on Map

  12. 12

    I am not able to get a field in my Django ManyToMany Relation

  13. 13

    I am not able to get facebook user from this query

  14. 14

    With doctrine I am not able to get the right sequence name for Postgres

  15. 15

    I am not able to install svnnotify

  16. 16

    Not Able to get the full path of the file

  17. 17

    Not able to get attribute value, am I missing something?

  18. 18

    I am trying to get full path of upload control in jquery but not working

  19. 19

    Why am I able to open this file?

  20. 20

    I am not able to get data from my localhost using this code. Please help me. I am getting nil

  21. 21

    I am trying to read a file and to show the reading progress in %. I have tried following code but I am not able to divide in chunks & show progress

  22. 22

    I am not able to create and store a zip file using php

  23. 23

    I am not able to build the job in jenkins,,,even I had given the path for github

  24. 24

    How come I, as a normal user, am able to change ownership of a file?

  25. 25

    Why am I able to still write to a file marked 400

  26. 26

    I am not able to get the currentActivity in unity,and i am getting the following error after the application is run in the device

  27. 27

    ClearCase: I am not able to get the files from Clearcase

  28. 28

    I am on Manjaro, and I am setting it up for JDBC, I have installed mariadb, mariadb-jdbc but I am not able to locate the /etc/my.conf file

  29. 29

    Why am I not able to get proper dates in my graph?

HotTag

Archive