You can create lines of data in behat scenario and read them line by line to process the data as you wish.


Scenario


Feature: Test

Scenario: I read lines
Given I have user below:
| id | 1 |
| name | inanzzz |
| dob | 1907 |

FeatureContext


use Behat\Gherkin\Node\TableNode;

class FeatureContext extends MinkContext
{
/**
* @param TableNode $tableNode
*
* @Given /^I have user below:$/
*/
public function iHaveUserBelow(TableNode $tableNode)
{
$user = [];
foreach ($tableNode->getRowsHash() as $key => $value) {
$user[$key] = $value;
}
print_r($user);
}
}

Output


Feature: Test

Scenario: I read lines
Array
(
[id] => 1
[name] => inanzzz
[dob] => 1907
)
Given I have user below:
| id | 1 |
| name | inanzzz |
| dob | 1907 |

1 scenario (1 passed)
1 steps (5 passed)
0m1.603s