SED/AWK: Add a string to multiple files matched by regex value from another source file

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a single source file which has multiple entries of this format:
some_id: some string
And a bunch of .txt files in different folders that have strings that are identified by id
id="some_id"
How do I parse the source file in a way so that each string in .txt file which has id matching one of source file be added a new parameter like so
id="some_id" some_param="some string"
which is taken from value of corresponding source file ID
Notes
- There can be multiple IDs in same file
- There are never duplicated IDs in any file
- They are never located on the same line
some_paramis a literal- it does't matter where to add new
some_param="string"as long as it is on the same line and spaced out
Some sample
source.yml
apples: Apples are very tasty
grapes: Grapes kind of ok
trees: Gain mass from CO2
strawberry: Yummy
fruits/foo.txt
This is some plain text
Toreplace id="apples" string contains
The most vitamin-rich berry is id="strawberry"
fruits/strange/grapes.txt
And id="grapes" the
questionable/trees.txt
Or id="tress"
Given this sample, script should turn fruits/foo.txt into:
This is some plain text
Toreplace id="apples" string contains some_param="Apples are very tasty"
The most vitamin-rich berry is id="strawberry" some_param="Yummy"
text-processing awk sed grep
add a comment |Â
up vote
1
down vote
favorite
I have a single source file which has multiple entries of this format:
some_id: some string
And a bunch of .txt files in different folders that have strings that are identified by id
id="some_id"
How do I parse the source file in a way so that each string in .txt file which has id matching one of source file be added a new parameter like so
id="some_id" some_param="some string"
which is taken from value of corresponding source file ID
Notes
- There can be multiple IDs in same file
- There are never duplicated IDs in any file
- They are never located on the same line
some_paramis a literal- it does't matter where to add new
some_param="string"as long as it is on the same line and spaced out
Some sample
source.yml
apples: Apples are very tasty
grapes: Grapes kind of ok
trees: Gain mass from CO2
strawberry: Yummy
fruits/foo.txt
This is some plain text
Toreplace id="apples" string contains
The most vitamin-rich berry is id="strawberry"
fruits/strange/grapes.txt
And id="grapes" the
questionable/trees.txt
Or id="tress"
Given this sample, script should turn fruits/foo.txt into:
This is some plain text
Toreplace id="apples" string contains some_param="Apples are very tasty"
The most vitamin-rich berry is id="strawberry" some_param="Yummy"
text-processing awk sed grep
elaborate your question: 1) could be there multiple ids in one file? 2) could they be located on the same line. Post some testable fragment
â RomanPerekhrest
Dec 7 '17 at 21:13
@RomanPerekhrest updated, not sure what you meant by testable fragment though.
â knitevision
Dec 7 '17 at 21:31
Where does thesome_paramcome from, or is it a literal?
â ilkkachu
Dec 7 '17 at 21:37
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a single source file which has multiple entries of this format:
some_id: some string
And a bunch of .txt files in different folders that have strings that are identified by id
id="some_id"
How do I parse the source file in a way so that each string in .txt file which has id matching one of source file be added a new parameter like so
id="some_id" some_param="some string"
which is taken from value of corresponding source file ID
Notes
- There can be multiple IDs in same file
- There are never duplicated IDs in any file
- They are never located on the same line
some_paramis a literal- it does't matter where to add new
some_param="string"as long as it is on the same line and spaced out
Some sample
source.yml
apples: Apples are very tasty
grapes: Grapes kind of ok
trees: Gain mass from CO2
strawberry: Yummy
fruits/foo.txt
This is some plain text
Toreplace id="apples" string contains
The most vitamin-rich berry is id="strawberry"
fruits/strange/grapes.txt
And id="grapes" the
questionable/trees.txt
Or id="tress"
Given this sample, script should turn fruits/foo.txt into:
This is some plain text
Toreplace id="apples" string contains some_param="Apples are very tasty"
The most vitamin-rich berry is id="strawberry" some_param="Yummy"
text-processing awk sed grep
I have a single source file which has multiple entries of this format:
some_id: some string
And a bunch of .txt files in different folders that have strings that are identified by id
id="some_id"
How do I parse the source file in a way so that each string in .txt file which has id matching one of source file be added a new parameter like so
id="some_id" some_param="some string"
which is taken from value of corresponding source file ID
Notes
- There can be multiple IDs in same file
- There are never duplicated IDs in any file
- They are never located on the same line
some_paramis a literal- it does't matter where to add new
some_param="string"as long as it is on the same line and spaced out
Some sample
source.yml
apples: Apples are very tasty
grapes: Grapes kind of ok
trees: Gain mass from CO2
strawberry: Yummy
fruits/foo.txt
This is some plain text
Toreplace id="apples" string contains
The most vitamin-rich berry is id="strawberry"
fruits/strange/grapes.txt
And id="grapes" the
questionable/trees.txt
Or id="tress"
Given this sample, script should turn fruits/foo.txt into:
This is some plain text
Toreplace id="apples" string contains some_param="Apples are very tasty"
The most vitamin-rich berry is id="strawberry" some_param="Yummy"
text-processing awk sed grep
edited Dec 7 '17 at 21:53
asked Dec 7 '17 at 21:04
knitevision
1085
1085
elaborate your question: 1) could be there multiple ids in one file? 2) could they be located on the same line. Post some testable fragment
â RomanPerekhrest
Dec 7 '17 at 21:13
@RomanPerekhrest updated, not sure what you meant by testable fragment though.
â knitevision
Dec 7 '17 at 21:31
Where does thesome_paramcome from, or is it a literal?
â ilkkachu
Dec 7 '17 at 21:37
add a comment |Â
elaborate your question: 1) could be there multiple ids in one file? 2) could they be located on the same line. Post some testable fragment
â RomanPerekhrest
Dec 7 '17 at 21:13
@RomanPerekhrest updated, not sure what you meant by testable fragment though.
â knitevision
Dec 7 '17 at 21:31
Where does thesome_paramcome from, or is it a literal?
â ilkkachu
Dec 7 '17 at 21:37
elaborate your question: 1) could be there multiple ids in one file? 2) could they be located on the same line. Post some testable fragment
â RomanPerekhrest
Dec 7 '17 at 21:13
elaborate your question: 1) could be there multiple ids in one file? 2) could they be located on the same line. Post some testable fragment
â RomanPerekhrest
Dec 7 '17 at 21:13
@RomanPerekhrest updated, not sure what you meant by testable fragment though.
â knitevision
Dec 7 '17 at 21:31
@RomanPerekhrest updated, not sure what you meant by testable fragment though.
â knitevision
Dec 7 '17 at 21:31
Where does the
some_param come from, or is it a literal?â ilkkachu
Dec 7 '17 at 21:37
Where does the
some_param come from, or is it a literal?â ilkkachu
Dec 7 '17 at 21:37
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Complex Grep + GNU Awk solution:
The crucial awk script content, let's say add_param_by_id.awk:
#!/bin/awk -f
BEGIN FS=":[[:space:]]+"
NR==FNR a[$1] = $2; next
match($0, /<id="([^"]+)"/, b) && b[1] in a
sub(/<id="[^"]+"/, "& some_param=42"a[b[1]]"42")
1
The main commands:
export pat="($(cut -d':' -f1 source.yml | paste -s -d'|'))"
grep -ElZr "<id="$pat"" --include=*.txt | xargs -0 -I sh -c
'awk -f add_param_by_id.awk source.yml "$1" > "/tmp/$$" && mv "/tmp/$$" "$1"' _
pat- variable containing regex alternation group with identifiers i.e.(apples|grapes|trees|strawberry)grep -ElZr id="$pat" --include=*.txt- prints all filenames which were matched for any of the specified identifiers
Example file content after processing:
This is some plain text
Toreplace string contains id="apples" some_param="Apples are very tasty"
The most vitamin-rich berry is id="strawberry" some_param="Yummy"
RomanPerekhrest I'm a bit sorry, I have overlooked the complexity of the source files. Is there a way to modify theregexto actually include every line, white space and character that is after the matchnup until (and excluding) id matchn+1? Like here pastebin.com/KbuBJvbC
â knitevision
Dec 9 '17 at 1:00
@knitevision, NEW conditions is a pretext for a NEW question
â RomanPerekhrest
Dec 9 '17 at 7:09
that would be a duplicated question and closed for sure I suppose :(
â knitevision
Dec 9 '17 at 12:28
add a comment |Â
up vote
2
down vote
With certain caveats, such as "no strange characters in filenames", and "no / characters in matching or substitution data values" this should work for you. It's not terribly efficient, in that it makes one pass through every file it can find for each line in the YAML file, but to fix that I would want more information about the relative size of the YAML file to the number of target files.
while IFS=: read -r id sp
do
id="id="$id"" sp="some_param="$sp:1""
find . -type f -name '*.txt' |
while IFS= read -r file
do
sed -i "/<$id/s/$/ $sp/" "$file"
done
done <source.yml
"no / characters in matching or substitution data values"... it's a lot more than that, you'll have to do some serious escaping if you want thatsedcommand to work with arbitrary input (imagine what happens ifsome_paramcontains&), not to mention that two nestedwhile..readloops to process text may result in the operator falling asleep... Also, I'm not sure why using*as a starting point forfind...
â don_crissti
Dec 7 '17 at 23:27
@don_crissti, yes I know, thanks. The (other solution)[unix.stackexchange.com/a/409591/100397] here also fails on "unintended" RE matches. I was trying to highlight shortcomings of this solution. Perhaps I'd have been better to keep quiet as it will satisfy the question asked here.
â roaima
Dec 8 '17 at 5:57
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Complex Grep + GNU Awk solution:
The crucial awk script content, let's say add_param_by_id.awk:
#!/bin/awk -f
BEGIN FS=":[[:space:]]+"
NR==FNR a[$1] = $2; next
match($0, /<id="([^"]+)"/, b) && b[1] in a
sub(/<id="[^"]+"/, "& some_param=42"a[b[1]]"42")
1
The main commands:
export pat="($(cut -d':' -f1 source.yml | paste -s -d'|'))"
grep -ElZr "<id="$pat"" --include=*.txt | xargs -0 -I sh -c
'awk -f add_param_by_id.awk source.yml "$1" > "/tmp/$$" && mv "/tmp/$$" "$1"' _
pat- variable containing regex alternation group with identifiers i.e.(apples|grapes|trees|strawberry)grep -ElZr id="$pat" --include=*.txt- prints all filenames which were matched for any of the specified identifiers
Example file content after processing:
This is some plain text
Toreplace string contains id="apples" some_param="Apples are very tasty"
The most vitamin-rich berry is id="strawberry" some_param="Yummy"
RomanPerekhrest I'm a bit sorry, I have overlooked the complexity of the source files. Is there a way to modify theregexto actually include every line, white space and character that is after the matchnup until (and excluding) id matchn+1? Like here pastebin.com/KbuBJvbC
â knitevision
Dec 9 '17 at 1:00
@knitevision, NEW conditions is a pretext for a NEW question
â RomanPerekhrest
Dec 9 '17 at 7:09
that would be a duplicated question and closed for sure I suppose :(
â knitevision
Dec 9 '17 at 12:28
add a comment |Â
up vote
1
down vote
accepted
Complex Grep + GNU Awk solution:
The crucial awk script content, let's say add_param_by_id.awk:
#!/bin/awk -f
BEGIN FS=":[[:space:]]+"
NR==FNR a[$1] = $2; next
match($0, /<id="([^"]+)"/, b) && b[1] in a
sub(/<id="[^"]+"/, "& some_param=42"a[b[1]]"42")
1
The main commands:
export pat="($(cut -d':' -f1 source.yml | paste -s -d'|'))"
grep -ElZr "<id="$pat"" --include=*.txt | xargs -0 -I sh -c
'awk -f add_param_by_id.awk source.yml "$1" > "/tmp/$$" && mv "/tmp/$$" "$1"' _
pat- variable containing regex alternation group with identifiers i.e.(apples|grapes|trees|strawberry)grep -ElZr id="$pat" --include=*.txt- prints all filenames which were matched for any of the specified identifiers
Example file content after processing:
This is some plain text
Toreplace string contains id="apples" some_param="Apples are very tasty"
The most vitamin-rich berry is id="strawberry" some_param="Yummy"
RomanPerekhrest I'm a bit sorry, I have overlooked the complexity of the source files. Is there a way to modify theregexto actually include every line, white space and character that is after the matchnup until (and excluding) id matchn+1? Like here pastebin.com/KbuBJvbC
â knitevision
Dec 9 '17 at 1:00
@knitevision, NEW conditions is a pretext for a NEW question
â RomanPerekhrest
Dec 9 '17 at 7:09
that would be a duplicated question and closed for sure I suppose :(
â knitevision
Dec 9 '17 at 12:28
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Complex Grep + GNU Awk solution:
The crucial awk script content, let's say add_param_by_id.awk:
#!/bin/awk -f
BEGIN FS=":[[:space:]]+"
NR==FNR a[$1] = $2; next
match($0, /<id="([^"]+)"/, b) && b[1] in a
sub(/<id="[^"]+"/, "& some_param=42"a[b[1]]"42")
1
The main commands:
export pat="($(cut -d':' -f1 source.yml | paste -s -d'|'))"
grep -ElZr "<id="$pat"" --include=*.txt | xargs -0 -I sh -c
'awk -f add_param_by_id.awk source.yml "$1" > "/tmp/$$" && mv "/tmp/$$" "$1"' _
pat- variable containing regex alternation group with identifiers i.e.(apples|grapes|trees|strawberry)grep -ElZr id="$pat" --include=*.txt- prints all filenames which were matched for any of the specified identifiers
Example file content after processing:
This is some plain text
Toreplace string contains id="apples" some_param="Apples are very tasty"
The most vitamin-rich berry is id="strawberry" some_param="Yummy"
Complex Grep + GNU Awk solution:
The crucial awk script content, let's say add_param_by_id.awk:
#!/bin/awk -f
BEGIN FS=":[[:space:]]+"
NR==FNR a[$1] = $2; next
match($0, /<id="([^"]+)"/, b) && b[1] in a
sub(/<id="[^"]+"/, "& some_param=42"a[b[1]]"42")
1
The main commands:
export pat="($(cut -d':' -f1 source.yml | paste -s -d'|'))"
grep -ElZr "<id="$pat"" --include=*.txt | xargs -0 -I sh -c
'awk -f add_param_by_id.awk source.yml "$1" > "/tmp/$$" && mv "/tmp/$$" "$1"' _
pat- variable containing regex alternation group with identifiers i.e.(apples|grapes|trees|strawberry)grep -ElZr id="$pat" --include=*.txt- prints all filenames which were matched for any of the specified identifiers
Example file content after processing:
This is some plain text
Toreplace string contains id="apples" some_param="Apples are very tasty"
The most vitamin-rich berry is id="strawberry" some_param="Yummy"
edited Dec 7 '17 at 23:01
answered Dec 7 '17 at 22:56
RomanPerekhrest
22.4k12145
22.4k12145
RomanPerekhrest I'm a bit sorry, I have overlooked the complexity of the source files. Is there a way to modify theregexto actually include every line, white space and character that is after the matchnup until (and excluding) id matchn+1? Like here pastebin.com/KbuBJvbC
â knitevision
Dec 9 '17 at 1:00
@knitevision, NEW conditions is a pretext for a NEW question
â RomanPerekhrest
Dec 9 '17 at 7:09
that would be a duplicated question and closed for sure I suppose :(
â knitevision
Dec 9 '17 at 12:28
add a comment |Â
RomanPerekhrest I'm a bit sorry, I have overlooked the complexity of the source files. Is there a way to modify theregexto actually include every line, white space and character that is after the matchnup until (and excluding) id matchn+1? Like here pastebin.com/KbuBJvbC
â knitevision
Dec 9 '17 at 1:00
@knitevision, NEW conditions is a pretext for a NEW question
â RomanPerekhrest
Dec 9 '17 at 7:09
that would be a duplicated question and closed for sure I suppose :(
â knitevision
Dec 9 '17 at 12:28
RomanPerekhrest I'm a bit sorry, I have overlooked the complexity of the source files. Is there a way to modify the
regex to actually include every line, white space and character that is after the match n up until (and excluding) id match n+1 ? Like here pastebin.com/KbuBJvbCâ knitevision
Dec 9 '17 at 1:00
RomanPerekhrest I'm a bit sorry, I have overlooked the complexity of the source files. Is there a way to modify the
regex to actually include every line, white space and character that is after the match n up until (and excluding) id match n+1 ? Like here pastebin.com/KbuBJvbCâ knitevision
Dec 9 '17 at 1:00
@knitevision, NEW conditions is a pretext for a NEW question
â RomanPerekhrest
Dec 9 '17 at 7:09
@knitevision, NEW conditions is a pretext for a NEW question
â RomanPerekhrest
Dec 9 '17 at 7:09
that would be a duplicated question and closed for sure I suppose :(
â knitevision
Dec 9 '17 at 12:28
that would be a duplicated question and closed for sure I suppose :(
â knitevision
Dec 9 '17 at 12:28
add a comment |Â
up vote
2
down vote
With certain caveats, such as "no strange characters in filenames", and "no / characters in matching or substitution data values" this should work for you. It's not terribly efficient, in that it makes one pass through every file it can find for each line in the YAML file, but to fix that I would want more information about the relative size of the YAML file to the number of target files.
while IFS=: read -r id sp
do
id="id="$id"" sp="some_param="$sp:1""
find . -type f -name '*.txt' |
while IFS= read -r file
do
sed -i "/<$id/s/$/ $sp/" "$file"
done
done <source.yml
"no / characters in matching or substitution data values"... it's a lot more than that, you'll have to do some serious escaping if you want thatsedcommand to work with arbitrary input (imagine what happens ifsome_paramcontains&), not to mention that two nestedwhile..readloops to process text may result in the operator falling asleep... Also, I'm not sure why using*as a starting point forfind...
â don_crissti
Dec 7 '17 at 23:27
@don_crissti, yes I know, thanks. The (other solution)[unix.stackexchange.com/a/409591/100397] here also fails on "unintended" RE matches. I was trying to highlight shortcomings of this solution. Perhaps I'd have been better to keep quiet as it will satisfy the question asked here.
â roaima
Dec 8 '17 at 5:57
add a comment |Â
up vote
2
down vote
With certain caveats, such as "no strange characters in filenames", and "no / characters in matching or substitution data values" this should work for you. It's not terribly efficient, in that it makes one pass through every file it can find for each line in the YAML file, but to fix that I would want more information about the relative size of the YAML file to the number of target files.
while IFS=: read -r id sp
do
id="id="$id"" sp="some_param="$sp:1""
find . -type f -name '*.txt' |
while IFS= read -r file
do
sed -i "/<$id/s/$/ $sp/" "$file"
done
done <source.yml
"no / characters in matching or substitution data values"... it's a lot more than that, you'll have to do some serious escaping if you want thatsedcommand to work with arbitrary input (imagine what happens ifsome_paramcontains&), not to mention that two nestedwhile..readloops to process text may result in the operator falling asleep... Also, I'm not sure why using*as a starting point forfind...
â don_crissti
Dec 7 '17 at 23:27
@don_crissti, yes I know, thanks. The (other solution)[unix.stackexchange.com/a/409591/100397] here also fails on "unintended" RE matches. I was trying to highlight shortcomings of this solution. Perhaps I'd have been better to keep quiet as it will satisfy the question asked here.
â roaima
Dec 8 '17 at 5:57
add a comment |Â
up vote
2
down vote
up vote
2
down vote
With certain caveats, such as "no strange characters in filenames", and "no / characters in matching or substitution data values" this should work for you. It's not terribly efficient, in that it makes one pass through every file it can find for each line in the YAML file, but to fix that I would want more information about the relative size of the YAML file to the number of target files.
while IFS=: read -r id sp
do
id="id="$id"" sp="some_param="$sp:1""
find . -type f -name '*.txt' |
while IFS= read -r file
do
sed -i "/<$id/s/$/ $sp/" "$file"
done
done <source.yml
With certain caveats, such as "no strange characters in filenames", and "no / characters in matching or substitution data values" this should work for you. It's not terribly efficient, in that it makes one pass through every file it can find for each line in the YAML file, but to fix that I would want more information about the relative size of the YAML file to the number of target files.
while IFS=: read -r id sp
do
id="id="$id"" sp="some_param="$sp:1""
find . -type f -name '*.txt' |
while IFS= read -r file
do
sed -i "/<$id/s/$/ $sp/" "$file"
done
done <source.yml
edited Dec 8 '17 at 6:03
answered Dec 7 '17 at 22:22
roaima
39.8k546109
39.8k546109
"no / characters in matching or substitution data values"... it's a lot more than that, you'll have to do some serious escaping if you want thatsedcommand to work with arbitrary input (imagine what happens ifsome_paramcontains&), not to mention that two nestedwhile..readloops to process text may result in the operator falling asleep... Also, I'm not sure why using*as a starting point forfind...
â don_crissti
Dec 7 '17 at 23:27
@don_crissti, yes I know, thanks. The (other solution)[unix.stackexchange.com/a/409591/100397] here also fails on "unintended" RE matches. I was trying to highlight shortcomings of this solution. Perhaps I'd have been better to keep quiet as it will satisfy the question asked here.
â roaima
Dec 8 '17 at 5:57
add a comment |Â
"no / characters in matching or substitution data values"... it's a lot more than that, you'll have to do some serious escaping if you want thatsedcommand to work with arbitrary input (imagine what happens ifsome_paramcontains&), not to mention that two nestedwhile..readloops to process text may result in the operator falling asleep... Also, I'm not sure why using*as a starting point forfind...
â don_crissti
Dec 7 '17 at 23:27
@don_crissti, yes I know, thanks. The (other solution)[unix.stackexchange.com/a/409591/100397] here also fails on "unintended" RE matches. I was trying to highlight shortcomings of this solution. Perhaps I'd have been better to keep quiet as it will satisfy the question asked here.
â roaima
Dec 8 '17 at 5:57
"no / characters in matching or substitution data values"... it's a lot more than that, you'll have to do some serious escaping if you want that
sed command to work with arbitrary input (imagine what happens if some_param contains &), not to mention that two nested while..read loops to process text may result in the operator falling asleep... Also, I'm not sure why using * as a starting point for find...â don_crissti
Dec 7 '17 at 23:27
"no / characters in matching or substitution data values"... it's a lot more than that, you'll have to do some serious escaping if you want that
sed command to work with arbitrary input (imagine what happens if some_param contains &), not to mention that two nested while..read loops to process text may result in the operator falling asleep... Also, I'm not sure why using * as a starting point for find...â don_crissti
Dec 7 '17 at 23:27
@don_crissti, yes I know, thanks. The (other solution)[unix.stackexchange.com/a/409591/100397] here also fails on "unintended" RE matches. I was trying to highlight shortcomings of this solution. Perhaps I'd have been better to keep quiet as it will satisfy the question asked here.
â roaima
Dec 8 '17 at 5:57
@don_crissti, yes I know, thanks. The (other solution)[unix.stackexchange.com/a/409591/100397] here also fails on "unintended" RE matches. I was trying to highlight shortcomings of this solution. Perhaps I'd have been better to keep quiet as it will satisfy the question asked here.
â roaima
Dec 8 '17 at 5:57
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409579%2fsed-awk-add-a-string-to-multiple-files-matched-by-regex-value-from-another-sour%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
elaborate your question: 1) could be there multiple ids in one file? 2) could they be located on the same line. Post some testable fragment
â RomanPerekhrest
Dec 7 '17 at 21:13
@RomanPerekhrest updated, not sure what you meant by testable fragment though.
â knitevision
Dec 7 '17 at 21:31
Where does the
some_paramcome from, or is it a literal?â ilkkachu
Dec 7 '17 at 21:37