I am trying to comparing two files and obtain the matching values. I tried this command:

```
grep -Fwf file_1.txt file_2.txt > matched_output.txt

```

However, this script **extracts only unique values**.

**File\_1.txt**

```
K00012  
K00012  
K00024  
K00024  
K00024  
K00027  
K00027  
K00027  
K00027  

```

**File\_2.txt**

```
ko:K00012 UGDH; UDPglucose 6-dehydrogenase  
ko:K00024 mdh; malate dehydrogenase  
ko:K00027 ME2; malate dehydrogenase (oxaloacetate-decarboxylating)
```

**Expected Output**

```
K00012 ko:K00012 UGDH; UDPglucose 6-dehydrogenase  
K00012 ko:K00012 UGDH; UDPglucose 6-dehydrogenase  
K00024 ko:K00024 mdh; malate dehydrogenase  
K00024 ko:K00024 mdh; malate dehydrogenase  
K00024 ko:K00024 mdh; malate dehydrogenase  
K00027 ko:K00027 ME2; malate dehydrogenase (oxaloacetate-decarboxylating)  
K00027 ko:K00027 ME2; malate dehydrogenase (oxaloacetate-decarboxylating)  
K00027 ko:K00027 ME2; malate dehydrogenase (oxaloacetate-decarboxylating)  
K00027 ko:K00027 ME2; malate dehydrogenase (oxaloacetate-decarboxylating)
```