custom feeders implementation

I am new to use scala and gatling. Wondering if you can give me some suggestions on how to do this:

I am trying to implement my own feeder function, which basically is reading a csv file and then massage the data and return for the httpconfig to use:

e,g, I have the feed file as groups.csv


the custom feeder will return groupname+"/community" if grouptype is community, and return groupname + “/others” when grouptype is group. There is a sample code here:

But that one randomly create the data. For me, I need to get each record from the csv file first and then manupulate the data accordingly and then feed it back to the httpConfig.

Thx advance for the help!

case header @ List(“groupname”, “grouptype”) => header

case List(groupname, “community”) => List(groupname + “/community”)
case List(groupname, _) => List(groupname + “/others”)
case r => throw new IllegalArgumentException("Unexpected record " + r)

csv produces an Array[Map[String, String]], so you just have to map it.

If you want to learn some Scala basics, I advice you have a look at the Twitter’s Scala School first chapters: