vendredi 19 février 2016

How to read from a file & store key:value pair in String Array?

I have a coffee script file with the following data in it. I want to create a string array that will store the following data as key:value pair in it.

abTests:
    productRanking:
      version: 4
      groups: [
        ratio:
          default: 1
          us: 0.90
          me: 0.0
        value: "LessPopularityEPC"
      ,
        ratio:
          default: 0
          us: 0.1
        value: "CtrEpcJob"
      ,
        ratio:
          default: 0
          me: 1.0
        value: "RandomPerVisitor"
      ]
    sabt:
      version: 1
      groups: [
        ratio:
          default: 1
          us: 0.90
        value: "default"
      ,
        ratio:
          default: 0
          us: 0.05
        value: "colorBoost"
      ,
        ratio:
          default: 0
          us: 0.05
        value: "colorPriority"
      ,
        ratio:
          default: 0
          us: 0
        value: "noColorClause"
      ]

I want to create a String Array with these data in the following format

productRanking:LessPopularityEPC
productRanking:CtrEpcJob
productRanking:RandomPerVisitor
sabt:default
sabt:colorboost
sabt:colorPriority
sabt:nocolorClause

Is there any way to solve this problem??

Aucun commentaire:

Enregistrer un commentaire