This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading contents of file into a Map

 
Bill Lee
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a script of reading the contents of a file directly into a map. I have no issues reading into list. But basically have a file that has 2 fields separated by a comma (i.e.

Chicago, IL
Sacramento, CA

Is this something that anyone has had experience with? Thanks.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you wanting for the key and value in the map? Something like...

[Chicago:IL]

???

We need more info as to what you are trying to achieve. This is just a guess.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
If you want a map with the city as key and the state as value, then try this:

Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic