# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/
(\d+)\t(\d+)/INSERT INTO loyalty_rule(rule_id_fk, loyalty_id_fk) VALUES ($1, $2);/gm;t' <<< "
6 9
6 10
8 11
9 12
10 13
11 14
12 15
13 16
14 17
15 18
16 19
17 20
18 21
19 22
20 23
5 24
4 25
21 26
22 27
1 28
23 29
24 30
25 31
26 32
27 33
28 34
29 35
30 36
31 37
32 38
33 39
34 40
35 41
36 42
37 43
38 44
39 45
40 46
41 47
42 48
43 49
44 50
45 51
46 52
47 53
48 54
49 55"
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html