# Join two csv file and modify the data

**URL:** <https://discuss.elastic.co/t/join-two-csv-file-and-modify-the-data/177742>\
**Category:** Elasticsearch\
**Created:** [April 21, 2019, 6:30am UTC](https://discuss.elastic.co/t/join-two-csv-file-and-modify-the-data/177742 "2019-04-21T06:30:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![koti](https://avatars.discourse-cdn.com/v4/letter/k/e9a140/32.png) [@koti](https://discuss.elastic.co/u/koti)\
**Post date:** [April 21, 2019, 6:30am UTC](https://discuss.elastic.co/t/join-two-csv-file-and-modify-the-data/177742/1 "2019-04-21T06:30:11Z")

</div>

I have two CSV files . I want to merge two CSV files based on common column **Location** and get the **DEPT** value in o/p . Please help me.

CSV1  
**Location Maximum Dept**  
High School1 25   
High School2 25

CSV2  
**Location Category Dept**  
High School1 1 Sales   
High School2 2 OPERATIONS

o/p  
**Location Maximum Dept**  
High School1 25 Sales  
High School2 25 OPERATIONS

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 21, 2019, 7:11am UTC](https://discuss.elastic.co/t/join-two-csv-file-and-modify-the-data/177742/2 "2019-04-21T07:11:31Z")

</div>

You need to do the join at index time ideally.  
So do that in your application or use an ETL like logstash may be.

---

<div class="post-metadata">

**Author:** ![koti](https://avatars.discourse-cdn.com/v4/letter/k/e9a140/32.png) [@koti](https://discuss.elastic.co/u/koti)\
**Post date:** [April 22, 2019, 3:42pm UTC](https://discuss.elastic.co/t/join-two-csv-file-and-modify-the-data/177742/3 "2019-04-22T15:42:50Z")

</div>

Thanks for the reply.  
Can you share the sample configfile

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 22, 2019, 4:33pm UTC](https://discuss.elastic.co/t/join-two-csv-file-and-modify-the-data/177742/4 "2019-04-22T16:33:22Z")

</div>

I don't have such a thing.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 20, 2019, 4:33pm UTC](https://discuss.elastic.co/t/join-two-csv-file-and-modify-the-data/177742/5 "2019-05-20T16:33:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
