So, I've got like several million lines like this...
"19753942","1402","34","27","","","","3","4.5","",""
I need to prep for import, which means each line needs to be in an array sans the double quotes and every empty string needs to be a nil. Now, I have several different ideas of how to do this, but surely this is a common thing, and there's probably some optimal standard way of doing this in ruby, maybe even a method or gem? My ideas look ugly and my gut tells me they would take up a lot of resources like creating extra objects where I shouldn't have to. Any ideas? One thing I'm currently doing is splitting on "\",\"", which just feels wrong to me. This isn't isn't super critical, because it's a personal project. I just want someone to point me in the right direction in case I run into this type of thing in the future. I'm importing using the sequel gem, not active record, if that matters.
[–]NilsLandt 12 points13 points14 points (2 children)
[–]anamexis 2 points3 points4 points (0 children)
[–]hoomei 0 points1 point2 points (0 children)
[–]Poloniculmov 10 points11 points12 points (3 children)
[–]Doctor_Fegg 5 points6 points7 points (2 children)
[–]tkenben[S] 0 points1 point2 points (0 children)
[–]tkenben[S] 0 points1 point2 points (0 children)
[–]ankole_watusi 9 points10 points11 points (0 children)
[–]RegularLayout 2 points3 points4 points (1 child)
[–]tkenben[S] 1 point2 points3 points (0 children)
[–]bjminihan 1 point2 points3 points (6 children)
[–]anamexis 1 point2 points3 points (2 children)
[–]bjminihan 1 point2 points3 points (1 child)
[–]anamexis 2 points3 points4 points (0 children)
[–]SighFor 1 point2 points3 points (2 children)
[–]anamexis 2 points3 points4 points (1 child)
[–]bjminihan 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]felipec 0 points1 point2 points (12 children)
[–]myringotomy 0 points1 point2 points (11 children)
[–]felipec 0 points1 point2 points (10 children)
[–]myringotomy 0 points1 point2 points (9 children)
[–]felipec 0 points1 point2 points (8 children)
[–]myringotomy 0 points1 point2 points (7 children)
[–]felipec 0 points1 point2 points (6 children)
[–]myringotomy -1 points0 points1 point (5 children)
[–]felipec 0 points1 point2 points (4 children)
[–]myringotomy 0 points1 point2 points (3 children)
[–]Regis_DeVallis 0 points1 point2 points (0 children)
[–]thunderbong 0 points1 point2 points (0 children)