# How to find csv text in another csv text?

**URL:** https://community.glideapps.com/t/how-to-find-csv-text-in-another-csv-text/57520
**Category:** Ask for Help
**Created:** [February 5, 2023, 9:51am UTC](https://community.glideapps.com/t/how-to-find-csv-text-in-another-csv-text/57520 "2023-02-05T09:51:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ToOFa\_Apps](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/toofa_apps/32/36816_2.png) [@ToOFa\_Apps](https://community.glideapps.com/u/ToOFa_Apps)
#### Post date: [February 5, 2023, 9:51am UTC](https://community.glideapps.com/t/how-to-find-csv-text-in-another-csv-text/57520/1 "2023-02-05T09:51:14Z")

</div>

How would i find the items in the csv on the right column inside the left column?  
Example: The first row contains My Calendar in both column.

 ![Screenshot 2023-02-05 at 11.37.03](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/3/a3c14e2056b22c3d693bd29b4a57aa1fdabfb105.png)

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [February 5, 2023, 9:57am UTC](https://community.glideapps.com/t/how-to-find-csv-text-in-another-csv-text/57520/3 "2023-02-05T09:57:56Z")

</div>

Just to be clear, are you looking for the intersection of the two lists?  
ie. those items that appear in both lists.

---

<div class="post-metadata">

### Author: ![ToOFa\_Apps](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/toofa_apps/32/36816_2.png) [@ToOFa\_Apps](https://community.glideapps.com/u/ToOFa_Apps)
#### Post date: [February 5, 2023, 10:01am UTC](https://community.glideapps.com/t/how-to-find-csv-text-in-another-csv-text/57520/4 "2023-02-05T10:01:19Z")

</div>

Yes. So if anything in second column matches anything first column then return TRUE otherwise FALSE. I will use the TRUE value to determine who on this table of users sees a message.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [February 5, 2023, 10:11am UTC](https://community.glideapps.com/t/how-to-find-csv-text-in-another-csv-text/57520/5 "2023-02-05T10:11:55Z")

</div>

Okay, this is just off the top of my head and it requires a few columns. There might be a shorter way - certainly it could be done with a single JavaScript column. But anyway…

- Convert both to arrays using Split Text columns
- Use the [Remove Elements from Array](https://www.glideapps.com/plugins/remove-all) plugin to remove all elements in the second array from the first.
- [Check the length](https://www.glideapps.com/plugins/array-length) of the resultant array and compare it to the original.
- If the length is shorter, then you have one or more intersecting items.

---

<div class="post-metadata">

### Author: ![ToOFa\_Apps](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/toofa_apps/32/36816_2.png) [@ToOFa\_Apps](https://community.glideapps.com/u/ToOFa_Apps)
#### Post date: [February 5, 2023, 10:13am UTC](https://community.glideapps.com/t/how-to-find-csv-text-in-another-csv-text/57520/6 "2023-02-05T10:13:28Z")

</div>

Interesting idea, okay thanks i will try that now👍

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [February 5, 2023, 10:30am UTC](https://community.glideapps.com/t/how-to-find-csv-text-in-another-csv-text/57520/7 "2023-02-05T10:30:18Z")

</div>

Here is a JavaScript option. I’d probably use this as it’s only a single column.

```auto
function intersection(list1, list2) {
  return list1.filter(function(item) {
    return list2.includes(item);
  });
}

let arr1 = p1.split(',');
let arr2 = p1.split(',');
return intersection(arr1,arr2);

```

---

<div class="post-metadata">

### Author: ![ToOFa\_Apps](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/toofa_apps/32/36816_2.png) [@ToOFa\_Apps](https://community.glideapps.com/u/ToOFa_Apps)
#### Post date: [February 5, 2023, 10:45am UTC](https://community.glideapps.com/t/how-to-find-csv-text-in-another-csv-text/57520/8 "2023-02-05T10:45:18Z")

</div>

It’s only the three extra columns, because i would need column 1,2 & 6 for any solution (besides if i used javascript)  
I’ll try the java script now and see.  
Thanks for your help on this👍

 ![Screenshot 2023-02-05 at 12.42.15](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/d/5d7d3f142a852526e4d82217656e0cdcf3a3a998.png)

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [February 6, 2023, 10:46am UTC](https://community.glideapps.com/t/how-to-find-csv-text-in-another-csv-text/57520/9 "2023-02-06T10:46:17Z")

</div>

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