-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
.../toJson/replace_allInPastedSubfieldOfArrayOfObjectsWithAsteriskWithGrouping/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"GST" : [ { | ||
"a" : "TestA1" | ||
}, { | ||
"a" : "TestB1", | ||
"b" : "TestB2" | ||
}, { | ||
"a" : "TestC1", | ||
"b" : "TestC2", | ||
"c" : "TestC3" | ||
} ], | ||
"subject" : [ { | ||
"name" : "Test", | ||
"altLabel" : [ "TestA1", "TestB1 ( TestB2 )", "TestC1 ( TestC2 TestC3 )" ] | ||
} ] | ||
} |
14 changes: 14 additions & 0 deletions
14
...son/toJson/replace_allInPastedSubfieldOfArrayOfObjectsWithAsteriskWithGrouping/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"GST" : [ | ||
{ | ||
"a" : "TestA1" | ||
}, { | ||
"a" : "TestB1", | ||
"b" : "TestB2" | ||
}, { | ||
"a" : "TestC1", | ||
"b" : "TestC2", | ||
"c" : "TestC3" | ||
} | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
...mJson/toJson/replace_allInPastedSubfieldOfArrayOfObjectsWithAsteriskWithGrouping/test.fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set_array("subject[]") | ||
add_field("subject[].$append.name","Test") | ||
set_array("subject[].$last.altLabel[]") | ||
|
||
do list(path:"GST[]", "var": "$i") # Other altLabels have a "," character between $a and $b. | ||
paste("subject[].$last.altLabel[].$append", "$i.a", "~(", "$i.b", "$i.c", "~)") | ||
end | ||
|
||
replace_all("subject[].*.altLabel[].*"," | \\( \\)","") |
8 changes: 8 additions & 0 deletions
8
...Json/toJson/replace_allInPastedSubfieldOfArrayOfObjectsWithAsteriskWithGrouping/test.flux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FLUX_DIR + "input.json" | ||
|open-file | ||
|as-records | ||
|decode-json | ||
|fix(FLUX_DIR + "test.fix") | ||
|encode-json(prettyPrinting="true") | ||
|write(FLUX_DIR + "output-metafix.json") | ||
; |
18 changes: 18 additions & 0 deletions
18
...oJson/replace_allInPastedSubfieldOfArrayOfObjectsWithAsteriskWithGrouping_2/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"GST" : [ { | ||
"a" : "TestA1" | ||
}, { | ||
"a" : "TestB1", | ||
"b" : "TestB2" | ||
}, { | ||
"a" : "TestC1", | ||
"b" : "TestC2", | ||
"c" : "TestC3" | ||
} ], | ||
"subject" : [ { | ||
"name" : "Test", | ||
"agent" : { | ||
"altLabel" : [ "TestA1", "TestB1 ( TestB2 )", "TestC1 ( TestC2 TestC3 )" ] | ||
} | ||
} ] | ||
} |
14 changes: 14 additions & 0 deletions
14
...n/toJson/replace_allInPastedSubfieldOfArrayOfObjectsWithAsteriskWithGrouping_2/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"GST" : [ | ||
{ | ||
"a" : "TestA1" | ||
}, { | ||
"a" : "TestB1", | ||
"b" : "TestB2" | ||
}, { | ||
"a" : "TestC1", | ||
"b" : "TestC2", | ||
"c" : "TestC3" | ||
} | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
...son/toJson/replace_allInPastedSubfieldOfArrayOfObjectsWithAsteriskWithGrouping_2/test.fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set_array("subject[]") | ||
add_field("subject[].$append.name","Test") | ||
set_array("subject[].$last.agent.altLabel[]") | ||
|
||
do list(path:"GST[]", "var": "$i") # Other altLabels have a "," character between $a and $b. | ||
paste("subject[].$last.agent.altLabel[].$append", "$i.a", "~(", "$i.b", "$i.c", "~)") | ||
end | ||
|
||
replace_all("subject[].*.agent.altLabel[].*"," | \\( \\)","") |
8 changes: 8 additions & 0 deletions
8
...on/toJson/replace_allInPastedSubfieldOfArrayOfObjectsWithAsteriskWithGrouping_2/test.flux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FLUX_DIR + "input.json" | ||
|open-file | ||
|as-records | ||
|decode-json | ||
|fix(FLUX_DIR + "test.fix") | ||
|encode-json(prettyPrinting="true") | ||
|write(FLUX_DIR + "output-metafix.json") | ||
; |
1 change: 1 addition & 0 deletions
1
...son/toJson/replace_allInPastedSubfieldOfArrayOfObjectsWithAsteriskWithGrouping_2/todo.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
See issue #278 |