Retrieve csv attachment file from gmail and place the data in a google spreadsheet

Viewed 5807

I currently receive emails from a specific source with multiple attachments specifically csv attachments. What I need is to retrieve the data from the csv attachment. I've looked into creating a Google App Script which I hear can get the job done based on my research but perhaps there is a better way if so please advice.

I wrote a pseudo code of what I would like the script to do:

  1. Determine who sent the email. If its the source that I need then follow to step 2.
  2. Look at the subject of the email if its the subject that I need then proceed to step 3.
  3. If step 1 and 2 are good then the next step is to retrieve the data from one of the csv attachments(based on the name) this is because there could be more than one attachment in the email.
  4. Open the attachment copy the data and paste it in either a google spreadsheet or excel spreadsheet which is created dynamically OR save the attachment to my google drive in a specific folder but either one could work. The trick here is to loop through all the emails in my inbox in past month and achieve the above task.

Thanks everyone for your help and I hope I was clear in my specifications.

Links I found to be helpful to me but not quite exactly what I need.

Create time-based Gmail filters with Google Apps Script

Trigger Google Apps Script by email

1 Answers
Related