How to read excel in Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 199

  • @manmohansingh1768
    @manmohansingh1768 4 ปีที่แล้ว +10

    I used to spend hours to learn this. But now understood only with your small video. Very nice. Thank you !!

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +3

      Glad to hear that Manmohan

    • @sonali420
      @sonali420 3 ปีที่แล้ว

      @@RaghavPal we have any video where we are filling any form and taking data from excel sheet

  • @nellyactif4396
    @nellyactif4396 ปีที่แล้ว

    Hello Raghav Pal. I just watched your video "How to read excel in Java" and I'm overwhelmed. Malheureusement je suis française et cela a été très dur pour moi de vous suivre. Mais encore une fois Merci Mille fois Merci

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Très bienvenu

  • @ravin6478
    @ravin6478 3 ปีที่แล้ว +1

    Thank you so much .. you have explained in simple manner.... now i am confident read excel files

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Glad to hear that Ravi

  • @miketysonschwarzeneggerpra9215
    @miketysonschwarzeneggerpra9215 4 ปีที่แล้ว

    Better channel about automation testing.
    Congratulations .
    Sensational.

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Thanks for watching

  • @trishikumar34
    @trishikumar34 ปีที่แล้ว

    Thank you sir, it’s very concise and to the point topic

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Most welcome Rishi

  • @moraisprata2177
    @moraisprata2177 ปีที่แล้ว

    Thank you dude, helped me a lot.

  • @aryankrishna5391
    @aryankrishna5391 ปีที่แล้ว

    Super Helpful!

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Happy to know this Aryan

  • @mastanvali405
    @mastanvali405 3 ปีที่แล้ว

    Thankyou for your clear explanation.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Most welcome

  • @suffrinbegam.s8157
    @suffrinbegam.s8157 3 ปีที่แล้ว

    Best best... 🔥

  • @uditmanerikar2355
    @uditmanerikar2355 4 ปีที่แล้ว +1

    Hi bro wonderful video made it look so easy.God bless.thanks for the detailed explanation

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Most welcome Udit

  • @pushpendersinghal5736
    @pushpendersinghal5736 2 ปีที่แล้ว

    thanks for your video sir it help lots.

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Most welcome Pushpender

  • @_KaifSayyad
    @_KaifSayyad 4 ปีที่แล้ว

    Being a student it was very useful ....😍.Keep it up sir.....

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Thank you Kaif

  • @nellyactif4396
    @nellyactif4396 ปีที่แล้ว

    I am delighted to find you on the Udemy website

  • @mohammadahmedragab837
    @mohammadahmedragab837 3 ปีที่แล้ว

    great simple concise explanation ❤️

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Thanks Ahmed

  • @anukumari6700
    @anukumari6700 3 ปีที่แล้ว

    Very nice explanation, Thank you!

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      You are welcome Anu

  • @sharifulhaque6809
    @sharifulhaque6809 4 ปีที่แล้ว

    Just Excellent work you have done brother. I really mean it. Super Like for your superb way of teaching. Please continue it....

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Thank you so much Shariful

  • @shikhajain5833
    @shikhajain5833 4 ปีที่แล้ว

    I must say it is very good video. Your way of explanation is very cool... good work.. keep it up

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Thanks and welcome Shikha

  • @MDHOSSAIN-gj5ve
    @MDHOSSAIN-gj5ve 4 ปีที่แล้ว

    Very good explanation. Thank you....

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      You're welcome

  • @ladyrebecca
    @ladyrebecca 2 ปีที่แล้ว

    At 3:40 you say you'll "Correct the identation?" I think? What does that mean? Why are we doing it? When I click Ctrl+A and Ctrl+I it doesn't seem to do anything.
    More importantly, are you just clicking Ctrl+S to save? Because that also does not work for me. When I save either from the File drop-down or by clicking Ctrl+S, it does not give me Maven dependencies on the left.

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      You can Go to Source | Format Document or press Ctrl+Shift+F.

  • @salesforceWithParamita
    @salesforceWithParamita 3 ปีที่แล้ว

    excellent it's explained so nicely. Thanks a lot.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      Most welcome

  • @sunitapatra4386
    @sunitapatra4386 2 ปีที่แล้ว +1

    Hi Raghav.. Thanks for sharing your knowledge. I would like to request you to add collection concepts in java.

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      I will plan it Sunita

  • @neerajpandey8499
    @neerajpandey8499 4 ปีที่แล้ว

    Kudos..🙏🙏

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Thanks Neeraj

  • @yoshitamahajan353
    @yoshitamahajan353 3 ปีที่แล้ว

    Thank u so much it is working!

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      You're welcome Yoshita

  • @technubie
    @technubie 3 ปีที่แล้ว

    Useful

  • @ilavarasansriraman4140
    @ilavarasansriraman4140 3 ปีที่แล้ว

    Wow 🎯

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Thanks Ilavarasan

  • @monil.joshi4
    @monil.joshi4 ปีที่แล้ว

    Hi Raghav
    Thanks for the video.. As usual explained step by step..
    How Can we read/write excel available on onedrive in selenium.. Please help me with that

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Hi Monill,
      Yes, you can use Java or Python to read and write Excel files on OneDrive.
      For java you can do by using the Microsoft Graph API and OpenXML library. Here are the steps to do this:
      Authenticate your OneDrive account: You can use the OAuth 2.0 protocol to authenticate your OneDrive account. You can use the MSAL Java library to implement the authentication process.
      Access the OneDrive API: Once you are authenticated, you can use the Microsoft Graph API to access the OneDrive API. You can use the Microsoft Graph Java SDK to interact with the API.
      Use the OpenXML library: To read and write Excel files in Java, you can use the OpenXML library. This library provides a simple interface to work with Excel files and can be used to read and write data to Excel files.
      Here's a sample code in Java to read an Excel file from OneDrive using Selenium and OpenXML:
      import com.microsoft.aad.msal4j.ConfidentialClientApplication;
      import com.microsoft.aad.msal4j.IAuthenticationResult;
      import com.microsoft.graph.authentication.TokenCredentialAuthProvider;
      import com.microsoft.graph.models.DriveItem;
      import com.microsoft.graph.models.Workbook;
      import com.microsoft.graph.models.WorkbookRange;
      import com.microsoft.graph.requests.DriveItemContentRequestBuilder;
      import com.microsoft.graph.requests.WorkbookRequestBuilder;
      import com.microsoft.graph.requests.WorkbookWorksheetCollectionRequestBuilder;
      import com.microsoft.graph.requests.WorkbookWorksheetRangeRequestBuilder;
      import com.microsoft.graph.requests.WorkbookWorksheetRequestBuilder;
      import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
      import org.apache.poi.ss.usermodel.Cell;
      import org.apache.poi.ss.usermodel.Row;
      import org.apache.poi.ss.usermodel.Sheet;
      import org.apache.poi.ss.usermodel.WorkbookFactory;
      import java.io.IOException;
      import java.io.InputStream;
      import java.util.Arrays;
      public class OneDriveExcelReader {
      public static void main(String[] args) {
      // Define the OneDrive credentials
      String clientId = "your_client_id";
      String clientSecret = "your_client_secret";
      String tenantId = "your_tenant_id";
      String authority = "login.microsoftonline.com/" + tenantId;
      String[] scopes = {"graph.microsoft.com/.default"};
      // Define the Excel file details
      String fileUrl = "graph.microsoft.com/v1.0/me/drive/root:/Documents/Excel/file.xlsx:/content";
      try {
      // Authenticate the OneDrive account
      ConfidentialClientApplication app = ConfidentialClientApplication.builder(clientId, clientSecret)
      .authority(authority)
      .build();
      IAuthenticationResult result = app.acquireTokenSilent(scopes).join();
      if (result == null) {
      result = app.acquireToken(scopes).join();
      }
      // Authenticate the Graph SDK with the access token
      TokenCredentialAuthProvider authProvider = new TokenCredentialAuthProvider(result.accessToken());
      // Access the OneDrive API and get the Excel file
      DriveItemContentRequestBuilder contentRequestBuilder = new DriveItemContentRequestBuilder(fileUrl, null);
      InputStream excelInputStream = contentRequestBuilder.buildRequest(authProvider).get();
      // Load the Excel file using OpenXML
      org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(excelInputStream);
      Sheet sheet = workbook.getSheetAt(0);
      // Print the contents of the Excel file
      for (Row row : sheet) {
      for (Cell cell : row) {
      System.out.print(cell.toString() + "\t");
      }
      System.out.println();
      }
      } catch (Exception ex) {
      ex.printStackTrace();
      }
      }
      }

    • @monil.joshi4
      @monil.joshi4 ปีที่แล้ว

      @@RaghavPal Hi Raghav thank you for quick response.. I tried this earlier before posting but it was difficult.. Yesterday after your message I tried to implement this but it gives me compile time error for acquireTokenSilent as required type SilentParameters provided string[] and many more compile time errors.. Can you suggest or create a video which shows this line by line
      I tried some videos and microsoft docs to setup Microsoft auth

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      I will plan to do some session, but for now pls keep checking online and trying things

  • @disharamrakhyani6909
    @disharamrakhyani6909 2 ปีที่แล้ว

    Hi Raghav , must say this video was very helpful . Just wanted to know If I want data to printed in txt file . so is there any video for it.

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Thanks Disha, not yet created on that, can find some online help

  • @JassiArtWork
    @JassiArtWork 3 ปีที่แล้ว

    its helpful

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      Thanks Jaspinder

  • @emotionsjourney479
    @emotionsjourney479 4 ปีที่แล้ว

    Hi Raghava, Thanks for all the wonderful sessions, can you please make videos on Neoload

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Will try my best

  • @kobemoses7987
    @kobemoses7987 2 ปีที่แล้ว

    Awesome thank you Sir, Do you have lessons for Blue Prism Automation?

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว +1

      Not yet Kobe

    • @kobemoses7987
      @kobemoses7987 2 ปีที่แล้ว

      @@RaghavPal
      Hopefully you will do soon. I appreciate you man

  • @paurnimabhikne4520
    @paurnimabhikne4520 ปีที่แล้ว

    can you please tell me how are filling any form and taking data from excel sheet using selenium. pleaase please please tell me.

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      This is all coded in the library we are using, as in here Apache POI

  • @petyapetrova9956
    @petyapetrova9956 ปีที่แล้ว

    Hi, I need to import data from excel in dto, we already have this with csv format. Can this be usefully for my task?

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Hi Petya
      Yes, you can use the CSV format to import data from Excel into a DTO. Here are the steps on how to do it:
      1. Open the CSV file in a text editor.
      2. Identify the column names in the CSV file.
      3. Create a DTO class with the same column names as the CSV file.
      4. Use the `CSVReader` class to read the data from the CSV file into a List of objects of the DTO class.
      5. Use the `List` of objects to populate the DTO object in your application.
      Here is an example of how to import data from CSV file into a DTO in Java:
      ```java
      import java.io.FileReader;
      import java.io.IOException;
      import java.util.List;
      import com.opencsv.CSVReader;
      public class CSVImporter {
      public static void main(String[] args) throws IOException {
      // Create a CSVReader object.
      CSVReader reader = new CSVReader(new FileReader("data.csv"));
      // Skip header.
      reader.readNext();
      // Read data from CSV file into a List of objects.
      List products = reader.readAll();
      // Iterate over the List of products and print them to the console.
      for (Product product : products) {
      System.out.println(product);
      }
      }
      }
      class Product {
      private String id;
      private String name;
      private double price;
      public Product(String id, String name, double price) {
      this.id = id;
      this.name = name;
      this.price = price;
      }
      public String getId() {
      return id;
      }
      public String getName() {
      return name;
      }
      public double getPrice() {
      return price;
      }
      }
      ```
      I hope this helps

  • @Nawshad5
    @Nawshad5 4 ปีที่แล้ว

    Hi Raghav, I definitely appreciate your awesome work. Your explanation is very nice. are you planning to upload video for writing on the same excel file where it reads from? Also, if there is a scenario like - I read data from excel and use it on an web application, then it generate a case number, then write the case number in the same excel file , and read that case number again from the excel file to do next step in the web application. Please advice. Thanks

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Thanks for watching. I will try to add a session on this

  • @tiago4587
    @tiago4587 2 ปีที่แล้ว +1

    I don't know if you're still reading this.... but when I try to run the ExcelUtils class for the first time, I get the following error: Error: Main class utils.ExcelUtils could not be found or loaded.
    Cause: java.lang.ClassNotFoundException: utils.ExcelUtils
    how can i fix this?

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Tiago, pls see if the required libraries are added in the project and imported in the class

    • @tiago4587
      @tiago4587 2 ปีที่แล้ว

      @@RaghavPal Yes they are. Version 5.2.2

  • @aymankobbi6937
    @aymankobbi6937 3 ปีที่แล้ว

    Nice job, i just want to know if there's a documentation for this method. because i'm writing my end of study memory about massive data import with Java.
    Thanks in advance

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Hi Ayman, will need to check

  • @SDPani-kn4en
    @SDPani-kn4en 3 ปีที่แล้ว +1

    Can we pass CSV file path on the place of excelfilepath?

  • @iam_kundan
    @iam_kundan 4 ปีที่แล้ว

    Hi Raghav , Thank you for this excellent tutorial . Just a question - there are two types of jars 1) poi , 2) poi-ooxml . And in which case we should use what.
    Also to read from .csv file is there any java library like poi ??

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +3

      Hi Kundan, Apache POI contains HSSF implementation for Excel ’97(-2007) file format i.e XLS.
      Apache POI XSSF implementation should be used for Excel 2007 OOXML (.xlsx) file format.
      stackoverflow.com/questions/60217698/what-is-the-difference-between-poi-and-poi-ooxml
      For CSV you can use openCSV api
      stackabuse.com/libraries-for-reading-and-writing-csvs-in-java/

    • @iam_kundan
      @iam_kundan 4 ปีที่แล้ว

      Thank You !!

  • @mkarmakar3038
    @mkarmakar3038 4 ปีที่แล้ว

    Hi Raghav, I need to read .xlsb format. what changes should I make?

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Hi, You will need to check a java lib for that, I believe Apache POI does not support it yet
      stackoverflow.com/questions/14282164/exception-reading-xlsb-file-apache-poi-java-io-charconversionexception

    • @mkarmakar3038
      @mkarmakar3038 4 ปีที่แล้ว

      @@RaghavPal thanks Raghav.. That helped. I am able to read xlsb by using the given example shared on that forum. But still struggling with writing on xlsb. Converting xlsb to other option like xlsx is not valid in my case .. as xlsb is having some macro inside.. it would get lost if i do any file conversion. Any suggestion how i can write in xlsb file in java?

  • @mandar5005
    @mandar5005 2 ปีที่แล้ว

    Hi Raghav, how can we select a range from an excel in the same code.

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว +1

      Hi, I will need to check on that, Can try some examples online

  • @jerinthomas3283
    @jerinthomas3283 4 ปีที่แล้ว

    Informative. But same we have to do in loop, What should we do?

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Jerin, you can get the row count and then use loops like for or while loop for the iterations equal to the row count. This is an example. You can use loops based on your need

  • @saicharan8672
    @saicharan8672 4 ปีที่แล้ว

    Hi Raghav, iam getting org. Apache. Poi. ooxml.POIXMLException and InvocationTargetException @16:00

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Sai, pls check if you see Caused By section in your logs. A diff version of lib can work, Check community.smartbear.com/t5/SoapUI-Open-Source/ERROR-org-apache-poi-POIXMLException-java-lang-reflect/m-p/143361#M24280

  • @gayatri5397
    @gayatri5397 2 ปีที่แล้ว

    Hi Raghav, I am not able to add the POI dependency, it is throwing an error saying no such dependency found. Could you please suggest me how to resolve this issue?

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Gayatri, pls check if you have added the right dependency in pom.xml and have saved your project after that, You can check if its available in Maven Dependencies folder

    • @gayatri5397
      @gayatri5397 2 ปีที่แล้ว

      @@RaghavPal yes Raghav I have added the correct dependency but still not loading correctly can you suggest what steps can be taken in this case?

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Cannot say without checking the details, Try doing the setup again

  • @techguru8932
    @techguru8932 3 ปีที่แล้ว

    Hi raghav sir
    Please let me know that
    A row is having some empty cells, how to read those cells any idea you suggest me to read the same empty cell and store the same thing in the database
    I hope you have answer
    Waiting for your answer

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      will need to check, you may have to update the code in case it is getting null and put a condition to store null in db

    • @techguru8932
      @techguru8932 3 ปีที่แล้ว

      @@RaghavPal ok thanks

    • @techguru8932
      @techguru8932 3 ปีที่แล้ว

      Hi raghav sir
      Please let me know
      Example we are having a serial number column in Excel sheet, which is first column .now we are having one serial number which takes it and updates the same thing, how to do without a serial number need to store the serial number in the database

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      will need to create the code for this in your script or will need to handle on excel side

    • @techguru8932
      @techguru8932 3 ปีที่แล้ว

      @@RaghavPal will need to create code for this and how to ignore some cells in the Excel sheet and please create a video for reading the CSV file and storing in the db

  • @user-cw9pl2sv9o
    @user-cw9pl2sv9o 2 ปีที่แล้ว

    hello Ragav... I have a doubt.. how to get the phone number from excel sheet?
    Pls help me to sort out this....

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      do not have a specific session on this, can check the code online,

  • @sainiranjan40
    @sainiranjan40 4 ปีที่แล้ว

    Hello Raghav, I am trying to do validation. My execution inputs first statement and enters 'for' loop and 'if' loop but does not perform any action. What am I missing ? Any suggestion please
    public void getOrganizationName() throws Exception {
    elementActions.doSendKeysUsingByLocator(OrganizationName, readExcelData.getCellDataString("Sheet1", 0, 0));
    for (int i = 0; i

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Sai, Try to print, what you get fore entering for loop. Also print the values inside for loop, Remove break and check again Can check with break points and debugging.

    • @sainiranjan40
      @sainiranjan40 4 ปีที่แล้ว

      @@RaghavPal I tried inserting print statements but it is failing to load 2nd row from excel sheet.
      public void getOrganizationName() throws IOException {
      JSUtil.flashby(OrganizationName, driver, 16);
      String data = readExcelData.getCellDataString("Organizations", 0, 0);
      System.out.println(data); //PRINTS FIRST ROW
      elementActions.doSendKeysUsingByLocator(OrganizationName, readExcelData.getCellDataString("Organizations", 0, 0));
      for (int i = 1; i

  • @manoilayans
    @manoilayans 3 ปีที่แล้ว

    Hi Raghav, How to read Sharepoint Excel file using Maven+Java. Pls help

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      I have not worked on this one

  • @MustafizurRahman-on3lj
    @MustafizurRahman-on3lj 2 ปีที่แล้ว

    Hi Raghav,
    This video is very informative but I am facing problem when I have mix values of integer and string. Here only string type values can be read but when I have a column of int type then it is giving error.

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Mustafizur,
      you can use Object type

  • @venkatakarthikkumarreddyba6373
    @venkatakarthikkumarreddyba6373 3 ปีที่แล้ว

    Hii bro, ur class is very nice. Well explained but I need to implement in gradle instead of maven could u pls provided me vedio link for gradle impkentation.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Hi Venkata, you can check some Gradle videos here - automationstepbystep.com/

    • @venkatakarthikkumarreddyba6373
      @venkatakarthikkumarreddyba6373 3 ปีที่แล้ว

      @@RaghavPal hii bro have one doubt I am able to read the data from Excel file in stand alone but I need to push the code in git pipeline once we pushed the code into git. How it will take excel path bro since our excel path is system dependent right? How I need to give excel path for that bro?

  • @vvkrishna05
    @vvkrishna05 4 ปีที่แล้ว

    Hi Raghav,Can you upload a video how to read CSV files and is it possible to read a data based on column name for csv file

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Vamsi, I will do

  • @usmankarim5236
    @usmankarim5236 4 ปีที่แล้ว

    Great

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Thanks for watching Usman

  • @Nawshad5
    @Nawshad5 4 ปีที่แล้ว

    in this tutorial you showed for excel 1 row , what about if it is a multiple row excel data? Can you please guide us. Thanks

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi, sure I will create a session, basically you will need to add a loop to start from row 1 to the max no of rows available

  • @saidarekar548
    @saidarekar548 4 ปีที่แล้ว

    hi Raghav ...ur videos are so helpfull as its turning me from non tech to tech .... Upon trying to create in Excel in Java ..I am having a prob ...Please can you help me.... My Question is when I m adding dependencies poi-ooxml is coming in Red underline .... not sure Y ...I ignored it and moved ahead but when I am entering 'XSSFW' and pressing Ctrl+Spacebar .... I am not able to see drop down list ...its showing me "NO default Proposal" .... Please can you help me.

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Sai, that means the library is not added, hover over the red line and see what is the issue

  • @jeevanpoojary7879
    @jeevanpoojary7879 3 ปีที่แล้ว

    i am getting the exception as work book factory can not be resolved ,
    how to fix that problem sir?

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      Hi Jeevan, just check if you have added the right and all needed maven dependencies

    • @jeevanpoojary7879
      @jeevanpoojary7879 3 ปีที่แล้ว

      Thank you sir...

  • @BaybaySharkse
    @BaybaySharkse 11 หลายเดือนก่อน

    I'm unable to create xlsx file in my project can we do it externally

    • @RaghavPal
      @RaghavPal  11 หลายเดือนก่อน

      yes

    • @BaybaySharkse
      @BaybaySharkse 11 หลายเดือนก่อน

      @@RaghavPal could you please provide code?

    • @RaghavPal
      @RaghavPal  11 หลายเดือนก่อน

      I do not have a ready code handy.. can try with some online help

  • @sanmakssunny7
    @sanmakssunny7 3 ปีที่แล้ว

    is it possible to do this with column name instead of row column number

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      yes, can do it Sandeep, can check some examples online

  • @majesticasuals
    @majesticasuals 4 ปีที่แล้ว

    @16.40 I tried the same thing and it works with the try-catch method. But as soon as I try to remove the try-catch block, I am getting an IO exception error on the line:
    XSSFWorkbook workbook = new XSSFWorkbook(excelpath);
    Any ideas why this could be happening

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Hi Devang, yes because it expects you to catch the exception, You will either have to surround with try catch or throw exception

    • @majesticasuals
      @majesticasuals 4 ปีที่แล้ว

      @@RaghavPal This doesn't seem to be a neat approach provided by the library. Anyway thanks for the response. Really appreciated!

  • @sainiranjan40
    @sainiranjan40 4 ปีที่แล้ว

    As I run on local I have no issues but when I upload to Azure DevOps and run remotely, build failed with below errors. I was wondering why Azure DevOps failing to download the packages? Any suggestion please!
    [INFO] Compiling 32 source files to d:\a\1\s\ExceleRATE\target\classes
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR :
    [INFO] -------------------------------------------------------------
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[8,35] package org.apache.poi.ss.usermodel does not exist
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[9,37] package org.apache.poi.xssf.usermodel does not exist
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[10,37] package org.apache.poi.xssf.usermodel does not exist
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[18,9] cannot find symbol
    symbol: class XSSFWorkbook
    location: class com.qa.ExceleRATE.util.ReadExcelData
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[20,9] cannot find symbol
    symbol: class XSSFSheet
    location: class com.qa.ExceleRATE.util.ReadExcelData
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[31,34] cannot find symbol
    symbol: class XSSFWorkbook
    location: class com.qa.ExceleRATE.util.ReadExcelData
    [INFO] 6 errors

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Hi Sai, sorry for late reply. Not much knowledge yet on Azure. Will have to check online

  • @saifrehman9947
    @saifrehman9947 3 ปีที่แล้ว

    What to do if there are multipe values in excel..... ????

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      You will need to get the values and in your code you can separate them in a loop and store in a list

  • @roshankannu5453
    @roshankannu5453 2 ปีที่แล้ว

    How to fetch values using conditione in Excel using Apache poi

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      will need to check some examples online

  • @seriousthing240
    @seriousthing240 4 ปีที่แล้ว

    What is meaning by artifactory why used and that benifites

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi, which video is this related to. Also tell the time in the video so I can refer

  • @rhaymiphone
    @rhaymiphone 4 ปีที่แล้ว +2

    thank you

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +2

      Hi Mario, testing is a wide field. I will suggest you can learn the tools and automation testing as per needs, CI, CD DevOps, RPA so many options are there and future is good

  • @Shecandoitsir
    @Shecandoitsir 3 ปีที่แล้ว

    Can you give sample code How to read list of the data

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      I will check on that

  • @RR_Lifestyle17
    @RR_Lifestyle17 4 ปีที่แล้ว

    Please do ETL Testing videos Raghav

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      I will do Rajesh, will take some time

    • @RR_Lifestyle17
      @RR_Lifestyle17 4 ปีที่แล้ว

      Ok Thank you Raghav

  • @salehashamim7803
    @salehashamim7803 3 ปีที่แล้ว

    I am having doubt but not on this topic.
    How to trim double quotes string that should print on excel in java.
    Not looking for console output.
    Example
    String s="aacfvbbgvv" ;
    s = s. replaceAll("[^a-zA-Z0-9]", "") ;
    System. Out. Println(s) ;
    This is coming on console. Let me know to print in excel from properties file

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Hi Saleha, pls check this stackoverflow.com/questions/2608665/how-can-i-trim-beginning-and-ending-double-quotes-from-a-string
      www.codegrepper.com/code-examples/css/java+remove+double+quotes+from+string

  • @b5etcraft
    @b5etcraft 3 ปีที่แล้ว

    how can i drag excel sheet and read it
    without put my own excel sheet?

    • @willvall7868
      @willvall7868 3 ปีที่แล้ว

      just put it in the folder...i think i don't got your problem xD

    • @b5etcraft
      @b5etcraft 3 ปีที่แล้ว

      @@willvall7868 I mean if someone use my system and he want to drag his own excel sheet how can I get. The path from drag ???

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Not sure if I got you completely, In simple words, You can keep a folder within your project to keep all your excel files and in the code provide a relative path to this folder. So it will work even if you take this on a new system. You have to ensure that the excel files should be in that folder

  • @sharathk6942
    @sharathk6942 4 ปีที่แล้ว +2

    It was not live session otherwise I would have told you where the mistake was
    NullPointerException🤣

  • @kavitamathpati6740
    @kavitamathpati6740 3 ปีที่แล้ว

    Hi raghav
    I have question
    Scenario like this:
    1. Your Business Analyst has asked to write an automation script which can search for iPhones
    having a maximum price of INR 40,000 on Flipkart website.
    2. The automation script should be capable of retrieving the device model with storage capacity
    and customer ratings.
    3. The information retrieved should be saved in a CSV file where data is sorted by Price in
    ascending order.
    Plz provide solution. I am waiting for it.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Hi Kavita, will need to write a custom script for this, As of now I do not have anything similar handy with me to share with you

    • @kavitamathpati6740
      @kavitamathpati6740 3 ปีที่แล้ว

      @@RaghavPal I tried many times now I need help
      not getting clearity about ₹40,000
      Used split and then if condition
      And I can not compaire price
      But I face difficulties
      Please do video on this and explain as early as possible
      I am waiting

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      I will try

  • @agalyaagal7774
    @agalyaagal7774 2 ปีที่แล้ว

    I'm getting error like can't open the specified file input stream form file location

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Check the path again, see if there are any extra spaces or typos

  • @ayshanasreen7068
    @ayshanasreen7068 3 ปีที่แล้ว

    New to Java. How to find excel file size?

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Hi Aysha, this can help stackoverflow.com/questions/12829002/how-to-get-the-size-in-bytes-of-an-excel-file-while-writing-to-it-in-apache-poi

  • @gopalkumrawat8630
    @gopalkumrawat8630 3 ปีที่แล้ว

    I am getting error please help me to resolve it
    "Could not find or load main class utils.Excelutils
    Caused by: java. lang.ClassNotfoundException: utils.Excelutils
    I am stuck on this error & unable to compile & run the code .
    Please someone help quickly. 🙏🏻🙏🏻

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      Hi Gopal, looks like the right libraries are not added. Just check after adding the dependencies in your pom.xml, save project and check in Maven Dependencies folder if you find the jars

    • @gopalkumrawat8630
      @gopalkumrawat8630 3 ปีที่แล้ว

      @@RaghavPal Sir I am unable to understand what to do in maven dependecies .
      I am following all your steps but it shows class not found exception .

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      in pom.xml we add the maven dependencies, Pls check

    • @gopalkumrawat8630
      @gopalkumrawat8630 3 ปีที่แล้ว

      @@RaghavPal okk sir thank you for reply . I was detect the problem and resolve that . The problem was you say to use new version of dependencies , I use 5.1.0 it can't work . Then , I see in your video you use 4.2.1 version of dependencies , it try it and works successfully.

  • @julikumari1970
    @julikumari1970 6 หลายเดือนก่อน

    We are not using fileInputStream....... Wanted to understand that.

    • @RaghavPal
      @RaghavPal  6 หลายเดือนก่อน

      Juli
      will need more details on that

  • @ponnidivya9009
    @ponnidivya9009 2 ปีที่แล้ว

    How to read xlsb files?

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว +1

      I will check on that, can try some online help

    • @ponnidivya9009
      @ponnidivya9009 2 ปีที่แล้ว

      @@RaghavPal Is it not possible in POI?Please try with EasyXls..

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      I will check

  • @sharathk6942
    @sharathk6942 4 ปีที่แล้ว

    You missed one more thing in the ExcelUtils class
    That is nothing but
    Return type of getRowCount()
    Return type of getCellData()
    You could have made return type as directly int and Object

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Hi Sharath, will check this

    • @vamshivishwanath
      @vamshivishwanath 6 หลายเดือนก่อน

      i am getting null point expection with same code in vedio what to do

  • @אייליקיר
    @אייליקיר 4 ปีที่แล้ว

    Hey! thanks so much, can I have the souce code.

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      I will add on github and update the link in description

    • @אייליקיר
      @אייליקיר 4 ปีที่แล้ว

      @@RaghavPal
      Hey, im trying to edit a cell. this is my code and it doesnt work. do you know why?
      String path = "./data/test.xlsx";
      XSSFWorkbook workbook = new XSSFWorkbook(path);
      XSSFSheet sheet = workbook.getSheet("one");
      Row theRow = sheet.getRow(i);
      theRow.getCell(j).setCellValue("YES");
      i and j are numbers

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Just check if it is able to resolve the path and get the workbook. Check logs

  • @ravikumarreddy5338
    @ravikumarreddy5338 3 ปีที่แล้ว

    If there is any empty cell then other cell is storing in Java code.my only que is how to read empty cell in Java code

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      Hi Ravi, this can help stackoverflow.com/questions/8529785/how-to-read-empty-cells-of-an-excel-file-using-poi

    • @ravikumarreddy5338
      @ravikumarreddy5338 3 ปีที่แล้ว

      @@RaghavPal I have gone through this codee,but it's not working

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      I will check more on this

  • @n0lor
    @n0lor 4 ปีที่แล้ว

    What about Google sheets?

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Will try to check on that. You can explore more online meanwhile

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw 4 ปีที่แล้ว

    Bro upload Java videos only from now onwards please

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Ravi, I will do more videos on java later. The existing videos are here - automationstepbystep.com/

  • @zstar8397
    @zstar8397 ปีที่แล้ว

    Hey hope you are doing alright just I wanna say that
    GOD loved the world so much he sent his only begotten
    son Jesus to die a brutal death for us so that we can have eternal life and we can all accept this amazing gift this by simply trusting in Jesus, confessing that GOD raised him from the dead, turning away from your sins and forming a relationship with GOD.