Issue with the text file

Hi Everyone,

image

this is my text file i am reading it using read text and converting that text into datatable using comma, the headers are repeated so i am removing the headers and writing it into an excel file
but i am getting a combined columns, i need them in this format CMPY,CCTR,PST,ST,LOB,BCO,DOLMM,DOLYY,LST,SALN,CRN CLAIM#,UNIT,CSTAT,AC,SA ,TRAN,PSTAT,CAT,NET-RESV-AMT,PAID-AMT,EXPENSE-AMT,RECOVERY-AMT,RESV-ON-PAID,WX CHK/EFT/BLO,OLD CLAIM#,DIST-CHNL

your screenshot shows the textfile to be tab delimited.

Try using read csv activity and setting the separator to ‘TAB’

I tried reading it in csv but the data is coming as a single column

Hi @Naruto ,

Welcome to the Community!

  1. Use Read Text File Activity
    This is fine as your first step.
  2. Use Generate Data Table Activity
    Set Delimiter to " " (space) or use custom logic to split based on multiple spaces.
    Enable “UseColumnHeaders” if the first row contains headers.
  3. Use Regex or Split Logic (if spacing is inconsistent)
    If columns are separated by multiple spaces, use a Regex pattern like:
    System.Text.RegularExpressions.Regex.Split(line, “\s{2,}”)

This splits the line wherever there are 2 or more spaces, which is common in fixed-width text files.

  1. Remove Repeated Headers
    Use a Filter Data Table or For Each Row loop to skip rows where the first column equals “CMPY” or similar.

  2. Write to Excel
    Use Write Range activity from UiPath.Excel.Activities (not deprecated) to export the cleaned DataTable.

Try these steps and let me know.

Happy Automation :star_struck: