# Import and read excel file using ionic

**URL:** <https://forum.ionicframework.com/t/import-and-read-excel-file-using-ionic/221200>\
**Category:** Ionic Framework\
**Created:** [March 9, 2022, 9:36am UTC](https://forum.ionicframework.com/t/import-and-read-excel-file-using-ionic/221200 "2022-03-09T09:36:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hbouamair](https://avatars.discourse-cdn.com/v4/letter/h/c77e96/32.png) [@hbouamair](https://forum.ionicframework.com/u/hbouamair)\
**Post date:** [March 9, 2022, 9:36am UTC](https://forum.ionicframework.com/t/import-and-read-excel-file-using-ionic/221200/1 "2022-03-09T09:36:39Z")

</div>

0

i want to upload a excel file and read it using ionic-angular , i try with this code but it doesn’t work for ionic app its just work for browser i dont know why ?

i want to read it and get a value from it and it doesn’t work in ionic app (android )  
if there is any plugin for excel file help me

this is my code

```auto
<ion-input #inputFile id="input-file" type="file" (change)="excelRead($event)" multiple></ion-input>

 public excelRead(e :any ){
    let fileReaded :any ;
    fileReaded = e.target.files[0];
    let type = e.target.files[0].name.split('.').pop();
   console.log(fileReaded.name)
    const schema = {
      'Material' :{
        prop : 'material',
        type : String ,
        required : false 

      } ,
      'Description' :{
        prop : 'description',
        type : String ,
        required : false 

      } ,
      'Emplacement' :{
        prop : 'emplacement',
        type : String ,
        required : false 

      } ,
      'Physique' :{
        prop : 'physique',
        type : Number ,
        required : false 

      } ,
      'Sap' :{
        prop : 'sap',
        type : Number ,
        required : false 

      } ,
      'Ecart' :{
        prop : 'ecart',
        type : Number ,
        required : false 

      } ,
      'Cagette' :{
        prop : 'cagette',
        type : String ,
        required : false 

      } ,

    };

  
    readXlsxFile(fileReaded, {schema}).then((data) =>{

      console.log("message1")
        if( data.rows){

          for (let i of data.rows){
            console.log("message2")
            this.inventaireTab.push(i);

          }                
        }
        console.log("message3")
        console.log(this.inventaireTab)

      for (let i = 0; i < this.inventaireTab.length; i++) {
      
   
      this.quantite.push(this.inventaireTab[i].physique) 
       
        
      }
      console.log(this.quantite)

    }
    
    
    
    )

  }

```

if you have any suggestion help me

---

<div class="post-metadata">

**Author:** ![abuabara](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@abuabara](https://forum.ionicframework.com/u/abuabara)\
**Post date:** [March 10, 2022, 8:48am UTC](https://forum.ionicframework.com/t/import-and-read-excel-file-using-ionic/221200/2 "2022-03-10T08:48:05Z")

</div>

I believe you need to work with .csv file format. I don’t have much experience, maybe this video can help (it works using ionic 4 and 5): [How to Import & Export CSV Data using Papa Parse with Ionic 4 - YouTube](https://www.youtube.com/watch?v=tyZjicNtbyk)
