# Getting specific records from a feeder.

**URL:** https://community.gatling.io/t/getting-specific-records-from-a-feeder/2574
**Category:** Gatling (Open-Source)
**Created:** [October 2, 2015, 8:56pm UTC](https://community.gatling.io/t/getting-specific-records-from-a-feeder/2574 "2015-10-02T20:56:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sachin\_kothe](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@sachin\_kothe](https://community.gatling.io/u/sachin_kothe)
#### Post date: [October 2, 2015, 8:56pm UTC](https://community.gatling.io/t/getting-specific-records-from-a-feeder/2574/1 "2015-10-02T20:56:06Z")

</div>

Hi,

I am trying to implement below case using gatling and need your help to do that.

File1.csv :  
id, remoteId  
1, 10  
2, 20

File2.csv :  
remoteId, description  
10, test1  
10, test2  
20, test3  
20, test4

I need to feed from first CSV file and loop through only the records from second CSV that matches the condition like

val file1 = csv(“File1.csv”).circular;

val someFunction = (remoteId) {  
// This should loop though the File2 and return only the record that matches the passed remoteId  
}

…

feed(file1)

val records = someFunction(${remoteId})

// loop through records in print description.

Please let me know how can i achieve it? Thanks.

---

<div class="post-metadata">

### Author: ![Alex\_R](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@Alex\_R](https://community.gatling.io/u/Alex_R)
#### Post date: [October 6, 2015, 2:14am UTC](https://community.gatling.io/t/getting-specific-records-from-a-feeder/2574/2 "2015-10-06T02:14:26Z")

</div>

Hi,

You can try dynamic csv file names. e.g.

File1.csv :  
id, remoteId  
1, 10  
2, 20

10.csv :  
remoteId, description  
10, test1  
10, test2

20.csv:

remoteId, description

20, test3  
20, test4

val scn = scenario(“foo”).feed(csv(“File1.csv”).circular) {

foreach("${remoteId}", “fileId”) {

feed(csv("${fileId}.csv"))  
.exec {  
…  
}  
}

Thanks,  
Alex.
