Documentation / Tutorials / Tutorials & How to’s

Importing Excel and CSV files in WordPress using Awesome Studio

/ Tutorials & How to’s / Importing Excel and CSV files in WordPress using Awesome Studio

It is very easy to import a large CSV or Excel file in WordPress, using Awesome Studio, all you need to do is

  1. Go to Awesome Studio -> Catalogue -> Modules -> Library
  2. Install Importer module
  3. Now put the shortcode on a page or app (use this option if you want to customise the look and feel)
    [aw2.moduel slug='importer' /]
  4. Or, you can use it directly from our CDN using
    [aw2.cdn run lib=importer module=parse /]

    this is the fastest option if you don't need to worry about the look and feel.

  5. Now, create a global module that will insert the parsed data. When you upload and start parsing the file, awesome studio stores the parsed data in the stack as parsed.data this can be accessed using aw2.loop. See the example below
    [aw2.loop parsed.data]
      [aw2.get item.0 /] 
      [aw2.get item.1 /] 
    [/aw2.loop]

    A column is accessed using item.(column number)

  6. Here is a working example of sample module to save parsed data
    [aw2.loop parsed.data]
      [aw2.query update_post_meta post_id="{module.post_id}"]
      {
      	"email":"[aw2.get item.0]",
      	"contact_source":"[aw2.get item.3]",
      	"contact_source_2":"[aw2.get item.4]",
      	"first_name":"[aw2.get item.1 /]",
      	"Last_Name":"[aw2.get item.2 /]",
       	"NOTES":"[aw2.get item.5 /]"
      }
      [/aw2.query]
    [/aw2.loop]

     

Once this is setup access the page with the module, upload the csv/xlsx file, hit the upload button.

Step 1 - importing large excel file in WordPress

Once the file is uploaded, you will get the option to provide the module slug for parsing. Once you hit the parse button it will start parsing 100 rows at a time and execute the provided module slug.

Step 2 - parse and import large csv file

So, just by setting up a module you a can import any type of large excel or CSV file within WordPress without timing out.

Categories
Most Popular