-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created objects that are kept in path: records with different ids but the same rvk elements, encoded them as json and reopened them with direction records as the record container. By that I am able to create a single record for each id.
- Loading branch information
Showing
3 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
"HT013166356, HT018625006, TT000577460","CI 5310","CI 5603","CI 1100","CI 1125","CI 5603","CI 5604","EC 2430","IH 34381" | ||
"HT013166356","CI 5310","CI 5603","CI 1100","CI 1125","CI 5604","EC 2430","IH 34381" | ||
"HT018625006","CI 5310","CI 5603","CI 1100","CI 1125","CI 5604","EC 2430","IH 34381" | ||
"TT000577460","CI 5310","CI 5603","CI 1100","CI 1125","CI 5604","EC 2430","IH 34381" |
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
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 |
---|---|---|
@@ -1,34 +1,41 @@ | ||
set_array("id") | ||
set_array("rvk[]") | ||
set_array("records[]") | ||
set_array("@id[]") | ||
set_array("@rvk[]") | ||
|
||
do list(path: "084??", "var": "$i") | ||
if any_match("$i.2", "rvk") | ||
copy_field("$i.a","rvk[].$append") | ||
copy_field("$i.a","@rvk[].$append") | ||
end | ||
end | ||
|
||
uniq("@rvk[]") | ||
|
||
|
||
do list(path: "035??", "var": "$i") | ||
if any_match("$i.a", "^\\(DE-605\\)(.*)") | ||
copy_field("$i.a","id.$append") | ||
copy_field("$i.a","@id[].$append") | ||
end | ||
end | ||
replace_all("id.*","^\\(DE-605\\)(.*)","$1") | ||
join_field("id",", ") | ||
replace_all("id[].*","^\\(DE-605\\)(.*)","$1") | ||
|
||
do list(path: "@id[]", "var": "$i") | ||
copy_field("$i","records[].$append.id") | ||
copy_field("@rvk[]","records[].$last.rvk[]") | ||
end | ||
replace_all("records[].*.id","^\\(DE-605\\)(.*)","$1") | ||
|
||
retain("rvk[]","id") | ||
vacuum() | ||
|
||
# Filter records without RVK | ||
unless exists("rvk[]") | ||
unless exists("@rvk[]") | ||
reject() | ||
end | ||
|
||
# Filter records without hbz ids | ||
unless exists("id") | ||
unless exists("@id[]") | ||
reject() | ||
end | ||
|
||
|
||
retain("records[]") | ||
|
||
|