5 ms·
csv.NewReader(f).ReadAll() takes 2 seconds in your favorite browser. you can add arguments for other seperators and iterate over it like everything else. I th
by notTooFarGone 3y ago
csv.NewReader(f).ReadAll() takes 2 seconds in your favorite browser.
you can add arguments for other seperators and iterate over it like everything else.
I think go is a very bad example of "wasteful and lack sufficient abstraction over common problems".
It's first and foremost easy and therefore a bit verbose. If you mean "wasteful" by LOC then I'm sorry about that but that's not its purpose.
- thimp 3y agoThat's only part of the problem that needs to be solved. I have to read the CSV off the network and parse each field out. In a better language for the task, which I can't choose. > t <- read_csv('https://media.githubusercontent.com/media/datablist/sample-csv-files/main/files/people/people-100.csv') ... > glimpse(t) Rows: 100 Columns: 9 $ Index <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,… $ `User Id` <chr> "88F7B33d2bcf9f5", "f90cD3E76f1A9b9", "DbeAb8CcdfeFC2c… $ `First Name` <chr> "Shelby", "Phillip", "Kristine", "Yesenia", "Lori", "E… $ `Last Name` <chr> "Terrell", "Summers", "Travis", "Martinez", "Todd", "D… $ Sex <chr> "Male", "Female", "Male", "Male", "Male", "Male", "Fem… $ Email <chr> "elijah57@example.net", "bethany14@example.com", "btho… $ Phone <chr> "001-084-906-7849x73518", "214.112.6044x4913", "277.60… $ `Date of birth` <date> 1945-10-26, 1910-03-24, 1992-07-02, 2017-08-03, 1938-… $ `Job Title` <chr> "Games developer", "Phytotherapist", "Homeopath", "Mar… So I'm forced to use a crutch, which is writing a lot of boilerplate.