'Importing .csv content from gmail into gsheet - script works - content shows strange symbols
when running my script to import .csv content from gmail it works and runs fine without any errors. But the content within the sheet is off. Strange thing is same script for other files works without problems - so I am wondering what is causing it. I checked the .csv and it is actually separated by semi colons (;) and structure wise it is exactly same as other .csvs where the script works fine. So I am really puzzled as why its not working, and it is every file from this person that I get daily that this doesnt work with.
  var threads = GmailApp.search('from:[email protected] subject:xyz');
  var messages = threads[0].getMessages();
  var file = messages[0].getAttachments()[0];
  var contents = Utilities.parseCsv(file.getDataAsString(), ";");
  var ss = SpreadsheetApp.getActiveSpreadsheet();  
  var sh0 = ss.getSheetByName("Test");
  sh0.clearContents();
  sh0.getRange(1, 1, contents.length, contents[0].length).setValues(contents);
This is what it looks like after the script ran successfully
Similar thing with another file in another sheet
Any help would be highly appreciated!
Kind regards
EDIT*:
Used belows formula. Unfortunately this only reduced the amount of symbols in the sheet.
(Compare it to above pictures)
If I increase the slicer to be more than the symbols I get following error:
TypeError: Cannot read property 'length' of undefined
*EDIT2:
Console log shows the same symbol as in screenshot. Here is the file: https://file.io/uh9thiY0ZKko
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source | 
|---|
