Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "toMap" to transform.Unmarshal CSV options #8859

Open
jmooring opened this issue Aug 5, 2021 · 0 comments
Open

Add "toMap" to transform.Unmarshal CSV options #8859

jmooring opened this issue Aug 5, 2021 · 0 comments
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented Aug 5, 2021

Current Functionality

structure

content/
└── posts/
    └── post-1/
        ├── data.csv
        └── index.md

content/posts/post-1/data.csv

"field_1";"field_2"
"foo";"bar"
"wibble";"wubble"

template

{{ $resource := .Resources.GetMatch "data.csv" }}
{{ $data := transform.Unmarshal (dict "delimiter" ";") $resource }}

resulting data structure

[
  [
    "field_1",
    "field_2"
  ],
  [
    "foo",
    "bar"
  ],
  [
    "wibble",
    "wubble"
  ]
]

Desired Functionality

template

{{ $resource := .Resources.GetMatch "data.csv" }}
{{ $data := transform.Unmarshal (dict "delimiter" ";" "toMap" true) $resource }}

resulting data structure

[
  {
    "field_1": "foo",
    "field_2": "bar"
  },
  {
    "field_1": "wibble",
    "field_2": "wubble"
  }
]

Details

@bep bep added Enhancement and removed Proposal labels Aug 5, 2021
@bep bep added this to the v0.88 milestone Aug 5, 2021
@bep bep modified the milestones: v0.88, v0.89 Sep 2, 2021
@bep bep modified the milestones: v0.89, v0.90 Nov 2, 2021
@bep bep modified the milestones: v0.90, v0.91.0 Dec 8, 2021
@bep bep modified the milestones: v0.91.0, v0.92.0 Dec 20, 2021
@bep bep modified the milestones: v0.92.0, v0.93.0 Jan 12, 2022
@bep bep modified the milestones: v0.93.0, v0.94.0 Mar 1, 2022
@bep bep modified the milestones: v0.94.0, v0.95.0, v0.96.0 Mar 9, 2022
@bep bep modified the milestones: v0.96.0, v0.97.0 Mar 24, 2022
@bep bep modified the milestones: v0.97.0, v0.98.0 Apr 13, 2022
@bep bep modified the milestones: v0.98.0, v0.99.0 Apr 28, 2022
@bep bep modified the milestones: v0.99.0, v0.100.0 May 24, 2022
@bep bep removed this from the v0.100.0 milestone May 31, 2022
@bep bep modified the milestones: v0.110.0, v0.111.0 Jan 26, 2023
@bep bep modified the milestones: v0.111.0, v0.112.0 Feb 15, 2023
@bep bep modified the milestones: v0.112.0, v0.113.0 Apr 15, 2023
@bep bep modified the milestones: v0.113.0, v0.115.0 Jun 13, 2023
@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 5, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep modified the milestones: v0.122.0, v0.123.0, v0.124.0 Jan 27, 2024
@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@jmooring jmooring changed the title Add "hasHeaderRow" to transform.Unmarshal CSV options Add "toMap" to transform.Unmarshal CSV options Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants