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
Use Read Text File Activity
This is fine as your first step.
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.
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.
Remove Repeated Headers
Use a Filter Data Table or For Each Row loop to skip rows where the first column equals “CMPY” or similar.
Write to Excel
Use Write Range activity from UiPath.Excel.Activities (not deprecated) to export the cleaned DataTable.