storing text file in dictionary

Page 1 of 1

1 Replies - 657 Views - Last Post: 28 August 2013 - 06:28 AM Rate Topic: -----

#1 vasant_Gowda  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 27-August 13

storing text file in dictionary

Posted 27 August 2013 - 10:31 PM

From following map file I wanna remove lines starts with # and read the file in another file and store it in a dictionary as a key,value pairs and extract and print the variables in Linux terminal using Python script. can anybody help

################################################################################
#
# Legend Map
#
# Definition:
# <LegendName> : <Color1> , <Color2> , ... , <ColorN>
#
################################################################################
#
#
# Standard Legend Animator - 9 Colors: Blue to Red
#
Standard_Animator: blue,3f7fff,00bfff,3fffbf,green,bfff3f,ffbf00,ff7f00,red
#
#
#
# Extended Legend Animator - 11 Colors: LightGray -- Blue to Red -- Magenta
#
Extended_Animator: LightGray, blue,3f7fff,00bfff,3fffbf,green,bfff3f,ffbf00,ff7f00,red, Magenta
#
#
# end

From following map file I wanna remove lines starts with # and read the file in another file and store it in a dictionary as a key,value pairs and extract and print the variables in Linux terminal using Python script. can anybody help

################################################################################
#
# Legend Map
#
# Definition:
# <LegendName> : <Color1> , <Color2> , ... , <ColorN>
#
################################################################################
#
#
# Standard Legend Animator - 9 Colors: Blue to Red
#
Standard_Animator: blue,3f7fff,00bfff,3fffbf,green,bfff3f,ffbf00,ff7f00,red
#
#
#
# Extended Legend Animator - 11 Colors: LightGray -- Blue to Red -- Magenta
#
Extended_Animator: LightGray, blue,3f7fff,00bfff,3fffbf,green,bfff3f,ffbf00,ff7f00,red, Magenta
#
#
# end

Is This A Good Question/Topic? 0
  • +

Replies To: storing text file in dictionary

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9497
  • View blog
  • Posts: 35,844
  • Joined: 12-June 08

Re: storing text file in dictionary

Posted 28 August 2013 - 06:28 AM

Please do not create duplicate topics.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1