DATA Step, Macro, Functions and more

Reading eml file with attached csv

Reply
Contributor
Posts: 67

Reading eml file with attached csv

Hi,

 

Could anyone please tell me how to read into sas csv file wich is attached in eml(email) file?

 

Thank you

PROC Star
Posts: 1,400

Re: Reading eml file with attached csv

Why not just download the CSV file and import it into SAS like any other CSV file?

Contributor
Posts: 67

Re: Reading eml file with attached csv

It`s repetitive process.
Super User
Super User
Posts: 9,799

Re: Reading eml file with attached csv

Several points here.  First, email is not an adequate data transfer medium, both from the fact it is unsecure (even possible just within the company), is secondly not necessarily checked to ensure data delivered is the same as sent, and thirdly open to limitations due to email size.  For data transfers use an sftp method, or secure portal.

Now in theory you could parse that file type and get the info, then drag out the file from there, but its not a good idea.  Get the file through a proper source - sftp, secure portal - save to version controlled secure environment.  Then have SAS read the plain text csv file from the version controlled secure enviroment.

Contributor
Posts: 67

Re: Reading eml file with attached csv

This  is only way we can do that automaticly...csv files are going to be encrypted, however files will not contain personal data.

Super User
Super User
Posts: 9,799

Re: Reading eml file with attached csv

[ Edited ]

CSV cannont be encrypted - CSV is a plain text file format with data delimited by commas.  What I suspect you mean is that the file will be WinZipped, and password protected.  Seen this many times, and it is a bit of joke really, someone who can intercept an email cant intercept the next email with the password?

Anyways, due to that you then have other layers, such as unzipping it, and as your not using a proper secure portal, you would need to run an md5 check to ensure the data is received as sent (all of which will be detailed in the data transfer agreement I would imagine).  It would then be a manual process to open the email, save the file, use the password to unpack the zip, then SAS can read the actual data.  So much more work than a simple sftp setup or secure portal (which your company likely already has).

 

Maxim 14:

https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers...

Contributor
Posts: 67

Re: Reading eml file with attached csv

[ Edited ]

The problem is this is external data(which not contain sensitive information about customer) sending from our provider, they are not going to send us this files any other way Smiley Sad.

But Maxim 14 was useful, I ve already solve the problem with Python.

 

Thanks 

Ask a Question
Discussion stats
  • 6 replies
  • 178 views
  • 0 likes
  • 3 in conversation