Cleaning up messy data in CSV file

I am new to Easy Data Transform and I think I am going to find this program very useful. The first thing I am trying to do is to transform a csv file containing the data from email notifications of eTransfers to our business account.

This is a little difficult as the contents of each column depend on whether the person sending the eTransfer actually included content such as a Message.

If they did, column six $(6) of the csv file will have the content “Message:” and the next column $(7) will have the actual message data. However if they don’t include a message, the column will have the content Date: and the next will contain the date of the transfer.

If they include several lines of a message, the different lines will each occupy a subsequent columns. So other responses will be offset by different amounts in the subsequent columns

I realise that I can use the IF option and select IF $(5) Starts with Message, then add a new column named Message with the data from $(6). But doing that and catching all the various for the Date being in columns 5,6,7,8,9,10,11 etc, would be a bit tedious.

I read through the Column variables help section, but couldn’t see if it was possible to reference a relative column name. eg. If ANY column contains “Message” THEN $(current column +1) is the value.

Is this possible and apologies if I have missed something obvious.

cheers
Darryl

Hi Darryl,

I can imagine that the schema options during import may help. But it would be helpful if you can add/publish small example of your source and the target you intend to reach.

We don’t support relative columns.

One possible approch is to Concat Cols for all email columns, then use Replace and a regular expression to add any missing columns on each row, then Split Cols to recreate the columns.

It would be helpful if you could supply a sample input CSV and the corresponding output you want .(paste them into your answer)

Another possibility is to use the Slide transform.

Then perhaps Concat Cols the message columns.

Thank you for the responses. You have given me some good tips. As Olaf suggested I should provide a copy of a file showing the issue I am dealing with. I have sanitised the data and eliminated columns which are irrelevant to the task as it is trivial to just delete some columns.

As a new member I wasn’t able to upload a csv file, so I have copied seven rows of the input csv file below and below it the result I am hoping to be able to achieve. I need to read up much more about data schemas in order to see if this may be the solution.

For these e-transfers we receive a text only email with the information shown. As not everyone remembers to add their account number to the Message field, not all the rows contain an account number and some add additional data that is not always relevant.

Thanks for any insights, tips or guidance you can provide.

$300.00 Date: Oct 26, 2026 Reference Number: CaussYdsEbw Sent From: Fred Jones Amount: $300.00 (CAD) FAQ For your security Click here to manage Acme e-Transfer
$300.00 Message: ACCT 11682 Date: Oct 22, 2026 Reference Number: C1AdfZdssdnqpM Sent From: Ben Goody Amount: $300.00 (CAD) FAQ For your security
$300.00 Date: Oct 17, 2026 Reference Number: C1ADESsjseNkT Sent From: Betty Blue Amount: $300.00 (CAD) FAQ For your security Click here to manage Acme e-Transfer
$300.00 Message: Bob D. 10051 Date: Oct 16, 2026 Reference Number: CAUg8XYsM Sent From: Jo Smith Amount: $300.00 (CAD) FAQ For your security
$225.00 Message: 1236 - 415 13th ave Date: Oct 11, 2026 Reference Number: CAqeX6y8 Sent From: BB Jones Amount: $225.00 (CAD) FAQ For your security
$300.00 Message: Account # 11525 Joe & Betsy 220-6th Ave Date: Oct 11, 2026 Reference Number: C1AYzE3TssccRS Sent From: Mary N May Amount: $300.00 (CAD)
$300.00 Message: 10498 Date: Oct 10, 2026 Reference Number: C1A83MssXmP42j Sent From: John A Blueberry Amount: $300.00 (CAD) FAQ For your security
Amount Date: Message Acct Name
$300.00 Oct 26, 2026 Fred Jones
$300.00 Oct 22, 2026 ACCT 11682 11682 Ben Goody
$300.00 Oct 17, 2026 Betty Blue
$300.00 Oct 16, 2026 Bob D. 10051 10051 Jo Smith
$225.00 Oct 11, 2026 12316 - 415 13th ave 12316 BB Jones
$300.00 Oct 11, 2026 Account # 11525 11525 Mary N May
$300.00 Oct 10, 2026 10498 10498 John A Blueberry

Filter for the rows with the starting string “Message” and not starting with “Message” in column 2.

After column renaming and removing not required columns you stack the tables by columns names.

As the Acct values is on different positions in the Message field there might be a solution to get it with a reg expression (but I’m not an expert for it), this step is not in my suggestion.

Cleaning.transform (5.4 KB)

Extract transformation might help to get the Acct Number

But it works only if the Acct number has in every case 5 digits and is unique in the field. It doesn’t work in row 5 there the number has 4 digits, but in your result example it has 5 digits, but not in the source table.

Cleaning2.transform (6.4 KB)