To get content from case attachment, loop on pyAttachments property and open the attach file based on they key of the elements in the list that are typed (should probably use attachment category to type those CSV files) that you are look for.
Once you have the object with the content you can apply some rule to parse it.
To see the right way to do it, just copy what Pega is doing ! Trace what is hapenning when you import a csv file into a data type !
You can use pxParseExcelFile Activity to read a spreadsheet. This is available since 8.1. Here is the param list if that helps.
A name of a file to parse
Template details in the Fileformat!Filename!xlsx format
Comma-separated value of sheet names. If the parameter is empty, an application skips the validation and parses all the sheets.
When checked, an application organizes parsed data sheetwise by using the pySheets(sheet name) page group.
An application returns a list of template sheets with a header that have two rows – a header and a property information, and a list of templates without a header with a row with property information only.
When the value is true, an application deletes the file after parsing.
When you define this parameter, an application saves all the error, warning, and information messages on this page. When you leave this parameter blank, an application saves the messages on the primary page.