0

I have received a blob containing a CSV file. Is there a way to skip the last row since they do not require parsing?

bero
  • 1
  • 1

1 Answers1

0

For this you can use compose connector with substring() expression. Here is an example

enter image description here

  • After receiving the csv file try to read the last index of '\n' and then use substring. Expression of lastIndexOf() in compose2 Connector:

    lastIndexOf(body('Get_blob_content_(V2)'),'\n')
    
  • Since you are adding '\n' in lastIndexOf the logic app takes it as '\n'. Hence you need to go to your code view and change it to '\n' resulting:

    lastIndexOf(body('Get_blob_content_(V2)'),'
    
    ')
    
  • Expression of substring() in compose Connector

    substring(body('Get_blob_content_(V2)'),0,outputs('Compose_2'))
    
  • you can even write it together as

    substring(body('Get_blob_content_(V2)'),0,lastIndexOf(body('Get_blob_content_(V2)'),'
    
    '))
    
SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18