In Csv file I want to delete all rows except first row

Hi @Gaurav_Gore

Read the CSV file & store the data in a data table. Use the following query in an Assign activity to keep only the first row:

yourDt = yourDt.AsEnumerable.Take(1).CopyToDataTable

Hope this helps,
Best Regards.

@Gaurav_Gore

Now, the transformer data is available in yourDt variable but you are writing DTWendy data to the file. Please make the necessary changes & let us know.

Best Regards.

Hello @Gaurav_Gore Try below steps:

  1. Read CSV file into variable > str_fileData
  2. Use Assign activity
    To: str_fileData
    Value: str_fileData.Split(Environment.NewLine.ToCharArray).First
  3. Use Write Text File activity
    Text: str_fileData
    WriteToFileName: str_File_Path_Of_Text_File

Xaml file for reference:
Test.xaml (5.6 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.