{"action":"created","issue":{"url":"https://api.github.com/repos/plumphp/plum-csv/issues/6","labels_url":"https://api.github.com/repos/plumphp/plum-csv/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/plumphp/plum-csv/issues/6/comments","events_url":"https://api.github.com/repos/plumphp/plum-csv/issues/6/events","html_url":"https://github.com/plumphp/plum-csv/pull/6","id":60113624,"number":6,"title":"Implementing CsvHeaderConverter","user":{"login":"Sgoettschkes","id":628796,"avatar_url":"https://avatars.githubusercontent.com/u/628796?v=3","gravatar_id":"","url":"https://api.github.com/users/Sgoettschkes","html_url":"https://github.com/Sgoettschkes","followers_url":"https://api.github.com/users/Sgoettschkes/followers","following_url":"https://api.github.com/users/Sgoettschkes/following{/other_user}","gists_url":"https://api.github.com/users/Sgoettschkes/gists{/gist_id}","starred_url":"https://api.github.com/users/Sgoettschkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sgoettschkes/subscriptions","organizations_url":"https://api.github.com/users/Sgoettschkes/orgs","repos_url":"https://api.github.com/users/Sgoettschkes/repos","events_url":"https://api.github.com/users/Sgoettschkes/events{/privacy}","received_events_url":"https://api.github.com/users/Sgoettschkes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-06T15:10:36Z","updated_at":"2015-03-06T19:05:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/plumphp/plum-csv/pulls/6","html_url":"https://github.com/plumphp/plum-csv/pull/6","diff_url":"https://github.com/plumphp/plum-csv/pull/6.diff","patch_url":"https://github.com/plumphp/plum-csv/pull/6.patch"},"body":"As discussed in #4, I implemented a Converter which takes the first row and stores the values for each cell. It then returns an array where the keys are the cells from the first row and the values are the cells from the current row. The example from my opening post in issue #4 is a good example of how it works.\r\n\r\nCurrently, the Converter also returns the header row, left unchanged. This is because returning `null` raises an error inside the Workflow (and registers an Exception within the `Result`) and returning an empty array means the following steps in the workflow must be prepared to work with an empty array as well.\r\n\r\nMy idea here is to also create a `CsvHeaderFilter` which returns false for the first item it gets and true for every following one, filtering only the header. This one can be used with or without the `CsvHeaderConverter` and might be usefull in other circumstances as well!"},"comment":{"url":"https://api.github.com/repos/plumphp/plum-csv/issues/comments/77616093","html_url":"https://github.com/plumphp/plum-csv/pull/6#issuecomment-77616093","issue_url":"https://api.github.com/repos/plumphp/plum-csv/issues/6","id":77616093,"user":{"login":"florianeckerstorfer","id":149201,"avatar_url":"https://avatars.githubusercontent.com/u/149201?v=3","gravatar_id":"","url":"https://api.github.com/users/florianeckerstorfer","html_url":"https://github.com/florianeckerstorfer","followers_url":"https://api.github.com/users/florianeckerstorfer/followers","following_url":"https://api.github.com/users/florianeckerstorfer/following{/other_user}","gists_url":"https://api.github.com/users/florianeckerstorfer/gists{/gist_id}","starred_url":"https://api.github.com/users/florianeckerstorfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianeckerstorfer/subscriptions","organizations_url":"https://api.github.com/users/florianeckerstorfer/orgs","repos_url":"https://api.github.com/users/florianeckerstorfer/repos","events_url":"https://api.github.com/users/florianeckerstorfer/events{/privacy}","received_events_url":"https://api.github.com/users/florianeckerstorfer/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T19:05:22Z","updated_at":"2015-03-06T19:05:22Z","body":"Great solution for the problem. But I am thinking if we should move this into the main `plum` repository and call it `HeaderConverter`. I guess it would be useful for other readers (such as `ExcelReader`).\r\n\r\nI also like the idea of a `HeaderFilter`, but I would call it `SkipFirstFilter` and it takes the number of rows to skip as argument."}}