ADF delete activity log

Yuan, Yan (CDC/DDPHSS/CSELS/DHIS) 0 Reputation points
2024-09-12T15:02:20.39+00:00

When I delete a file using ADF delete activity and enable log, a log is generated automatically as a CSV file. However, when I open the file, the ERROR column splits into two columns because the error message contains commas. For example: 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.'

I have tried reading the CSV file and changing the escape character to either backslash or double quotes, but the error still appears as two columns. I need assistance with resolving this issue.

User's image

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 33,071 Reputation points Volunteer Moderator
    2024-09-12T21:10:33.8233333+00:00

    To resolve this issue, here are a few steps you can try:

    1. Check the CSV File Format:
      • Ensure that any text fields in the CSV that contain commas are enclosed in double quotes ("). For example:
        
             "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
        
        
    2. Using an Escape Character:
      • If double quotes are not properly handling the commas, you could try changing the escape character when reading the file programmatically, like using a backslash (\) in custom readers that support escape sequences.
    3. Reading the CSV in PowerShell/Python:
      • In PowerShell:
             
             Import-Csv -Path "yourfile.csv" -Delimiter ','
             
        
        Ensure that the Import-Csv command correctly parses the fields based on the delimiters.
      • In Python (using pandas):
             
             import pandas as pd
             
             df = pd.read_csv('yourfile.csv', quotechar='"')
             
             print(df)
             
        
        The quotechar argument ensures that fields with commas are properly treated as a single column if they are wrapped in double quotes.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.