{"action":"created","issue":{"url":"https://api.github.com/repos/BurntSushi/rust-csv/issues/47","repository_url":"https://api.github.com/repos/BurntSushi/rust-csv","labels_url":"https://api.github.com/repos/BurntSushi/rust-csv/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/BurntSushi/rust-csv/issues/47/comments","events_url":"https://api.github.com/repos/BurntSushi/rust-csv/issues/47/events","html_url":"https://github.com/BurntSushi/rust-csv/issues/47","id":167764293,"number":47,"title":"Support for string delimiter?","user":{"login":"loggerhead","id":5056390,"avatar_url":"https://avatars.githubusercontent.com/u/5056390?v=3","gravatar_id":"","url":"https://api.github.com/users/loggerhead","html_url":"https://github.com/loggerhead","followers_url":"https://api.github.com/users/loggerhead/followers","following_url":"https://api.github.com/users/loggerhead/following{/other_user}","gists_url":"https://api.github.com/users/loggerhead/gists{/gist_id}","starred_url":"https://api.github.com/users/loggerhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loggerhead/subscriptions","organizations_url":"https://api.github.com/users/loggerhead/orgs","repos_url":"https://api.github.com/users/loggerhead/repos","events_url":"https://api.github.com/users/loggerhead/events{/privacy}","received_events_url":"https://api.github.com/users/loggerhead/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-27T03:48:53Z","updated_at":"2016-07-27T09:38:22Z","closed_at":null,"body":"For example, I have some data with below format:\r\n\r\n```rust\r\nlet data = \"\r\nsticker||mortals||7\r\nbribed||personae||7\r\nwobbling||poncing||4\r\ninterposed||emmett||9\r\nchocolate||refile||7\";\r\n```\r\n\r\nEverything is same as normal CSV data except the delimiter is `||` not `,`"},"comment":{"url":"https://api.github.com/repos/BurntSushi/rust-csv/issues/comments/235537019","html_url":"https://github.com/BurntSushi/rust-csv/issues/47#issuecomment-235537019","issue_url":"https://api.github.com/repos/BurntSushi/rust-csv/issues/47","id":235537019,"user":{"login":"loggerhead","id":5056390,"avatar_url":"https://avatars.githubusercontent.com/u/5056390?v=3","gravatar_id":"","url":"https://api.github.com/users/loggerhead","html_url":"https://github.com/loggerhead","followers_url":"https://api.github.com/users/loggerhead/followers","following_url":"https://api.github.com/users/loggerhead/following{/other_user}","gists_url":"https://api.github.com/users/loggerhead/gists{/gist_id}","starred_url":"https://api.github.com/users/loggerhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loggerhead/subscriptions","organizations_url":"https://api.github.com/users/loggerhead/orgs","repos_url":"https://api.github.com/users/loggerhead/repos","events_url":"https://api.github.com/users/loggerhead/events{/privacy}","received_events_url":"https://api.github.com/users/loggerhead/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T09:38:22Z","updated_at":"2016-07-27T09:38:22Z","body":"@BurntSushi I have to add two unused fields to fit the format.\r\n\r\n```rust\r\n#[derive(RustcDecodable)]\r\nstruct R {\r\n    uid: u64,\r\n    _1: Option<bool>,\r\n    name: String,\r\n    _2: Option<bool>,\r\n    avatar_url: String,\r\n}\r\n\r\nfn main() {\r\n    let data = \"\r\nsticker||mortals||7\r\nbribed||personae||7\r\nwobbling||poncing||4\r\ninterposed||emmett||9\r\nchocolate||refile||7\";\r\n\r\n    let mut rdr = csv::Reader::from_string(data)\r\n        .has_headers(false)\r\n        .delimiter(b'|');\r\n\r\n    let mut records: Vec<R> = Vec::new();\r\n    for record in rdr.decode() {\r\n        let r: R = record.unwrap();\r\n        records.push(r);\r\n    }\r\n}\r\n```\r\n\r\nBut what I want is something like:\r\n\r\n```rust\r\n    let mut rdr = csv::Reader::from_string(data)\r\n        .has_headers(false)\r\n        .delimiter(\"||\"); // Use a str as delimiter rather than a char.\r\n```"}}
{"actor":{"display_login":"loggerhead"}}