A:
The problem is the following (simplified):
(defn read-csv-file [filename]
(with-open [rdr (reader (InputStream. filename))]
(cs/read-csv rdr)))
This reads the whole file into memory, whereas what you wanted was to have the next three lines read the file line by line and then evaluate the second line with Clojure's I/O capabilities. So, you want to use streams, not readers. Readers cannot be used with a with-statement.
You could solve this by, for instance, first reading the whole file and then evaluating the second line, if you want to stick with reading in the whole file. Or, you can open a socket connection to a server that knows how to read a file, then use a similar with-statement, depending on your use case.
You could try using a defmacro to do this, but I suspect the macro will look a bit odd (and I haven't looked too deeply into how one would do it).
A:
You could use a.subs file to generate a new reader:
But honestly I'd probably just move to using a library that's meant to load text files.
A:
Using
with-open [rdr (io/reader filename)]
(csv/read-csv rdr)
instead of
(with-open [rdr (reader (InputStream. filename))]
(cs/read-csv rdr))
I was able to solve my problem.
A Foolproof Way to Stand Out at Your Next Interview
If you're applying for a job as a senior software developer, this news won't come as much of a surprise: You're likely not going to be the most qualified candidate on the team. Nevertheless, having a quality software developer on your team is worth more than the "only" one you can find in any given department. You know this, of course, and it's not your fault that this is the case.
Why do organizations prefer to hire software developers with less experience than candidates with more? It's not that they don't realize how important a strong developer is to a team's success; it's that it costs 01e38acffe
ENARM MÉXICO.
42
2013.
Edición: Viernes 4 de mayo de 2013.
ENARM MÉXICO.
4
DE EMPLEO.
Manual de trabajo de médicos clínicos
ARTÍCULO I-
LIMITACIONES
LIMITACIONES PARA EL UBIERTO
1
LIMITACIONES PARA LOS TESOREROS
LIMITACIONES PARA LOS TESOREROS
2
LIMITACIONES PARA LOS MATERIALES
LIMITACIONES PARA LOS MATERIALES
3
LIMITACIONES PARA LOS RECURSOS
LIMITACIONES PARA LOS RECURSOS
4
LIMITACIONES PARA LOS AGENTES
LIMITACIONES PARA LOS AGENTES
5
LIMITACIONES PARA LOS CABALLOS
LIMITACIONES PARA LOS CABALLOS
6
LIMITACIONES PARA LOS RECURSOS FINANCIEROS
LIMITACIONES PARA LOS RECURSOS FINANCIEROS
7
LIMITACIONES PARA LOS EXPERIENTES DE SALUD
LIMITACIONES PARA LOS EXPERIENTES DE SALUD
8
ARTÍCULO II-
CONTROL NACIONAL
CONTROL NACIONAL.
9
LIMITACIONES PARA LOS CABALLOS
LIMITACIONES PARA LOS CABALLOS
10
LIMITACIONES PARA LOS CABALLOS
LIMITACIONES PARA LOS CABALLOS
11
LIMITACIONES PARA LOS CABALLOS
LIMITACIONES PARA LOS CABALLOS
12
ARTÍCULO III-
GUERRA NACIONAL
GUERRA NACIONAL.
13
LIMITACIONES PARA LOS CABALLOS
LIMITACIONES PARA LOS CABALLOS
14
Related links:
Comments