# Extract multiple HLedger fields from a CSV column

**URL:** <https://forum.plaintextaccounting.org/t/extract-multiple-hledger-fields-from-a-csv-column/558>\
**Category:** General\
**Created:** [May 28, 2025, 12:41am UTC](https://forum.plaintextaccounting.org/t/extract-multiple-hledger-fields-from-a-csv-column/558 "2025-05-28T00:41:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![igbanam](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/igbanam/32/172_2.png) [@igbanam](https://forum.plaintextaccounting.org/u/igbanam)\
**Post date:** [May 28, 2025, 12:41am UTC](https://forum.plaintextaccounting.org/t/extract-multiple-hledger-fields-from-a-csv-column/558/1 "2025-05-28T00:41:56Z")

</div>

Hi all 👋

When importing into hledger, using rules, is there a way to break up a column into fields?

e.g. I have a CSV column with "Outward Instant Transaction CODE1 CODE2 REMARK TO BANK - ACCOUNT". This column contains…

```txt
"{marker} {txn ref} {remark} TO {description}"

```

How do I parse out these fields

_p.s: it's clear to me how to join columns to get a hledger field, I would like to do the reverse here._

_p.p.s: the full CSV line reads something like_

```txt
Outward Instant Transaction CODE1 CODE2 REMARK TO BANK - ACCOUNT, §, 12-Dec-2022, 12-Dec-2022, 300, "", ABC123

```

which I have translated to

```txt
%{field_to_extract_other_fields}, %{ignore_1}, %{date}, %{date2}, %{amount-out}, %{amount-in}, %{code}

```

Thanks!

---

<div class="post-metadata">

**Author:** ![simonmic](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/simonmic/32/1_2.png) [@simonmic](https://forum.plaintextaccounting.org/u/simonmic)\
**Post date:** [May 28, 2025, 12:50am UTC](https://forum.plaintextaccounting.org/t/extract-multiple-hledger-fields-from-a-csv-column/558/2 "2025-05-28T00:50:27Z")

</div>

You can't do it with hledger's CSV rules - you'd need to write your own little parser to pre-process and split the CSV into more columns.
