Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
irma2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gerhard Gonter
irma2
Commits
1c2665fa
Commit
1c2665fa
authored
2 years ago
by
Gerhard Gonter
Browse files
Options
Downloads
Patches
Plain Diff
script to extract data from eod_data.tsv to create a change report of UB
parent
4d63f0ff
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
filter_eod_report.pl
+45
-0
45 additions, 0 deletions
filter_eod_report.pl
with
45 additions
and
0 deletions
filter_eod_report.pl
0 → 100755
+
45
−
0
View file @
1c2665fa
#!/usr/bin/perl
use
strict
;
use
Data::
Dumper
;
$
Data::Dumper::
Indent
=
1
;
use
Util::
Simple_CSV
;
my
$fnm_in
=
shift
(
@ARGV
)
||
'
eod_data.tsv
';
my
$fnm_out
=
shift
(
@ARGV
)
||
'
report_bib.tsv
';
my
@columns_copy
=
qw(ac_number mms_id ticket val_hdl)
;
my
@columns_out
=
qw(ac_number mms_id alma_fetched ticket url nbn hdl val_hdl)
;
my
$tsv_in
=
Util::
Simple_CSV
->
new
(
load
=>
$fnm_in
,
separator
=>
"
\t
");
open
(
TSV_OUT
,
'
>:utf8
',
$fnm_out
)
or
die
;
print
TSV_OUT
join
("
\t
",
@columns_out
),
"
\n
";
my
$data
=
$tsv_in
->
{
data
};
# print __LINE__, " data: ", Dumper ($data);
foreach
my
$row
(
@$data
)
{
# print __LINE__, " row: ", Dumper ($row);
my
(
$update_url
,
$update_urn
,
$update_hdl
,
$update_doi
)
=
map
{
$row
->
{
$_
}
}
qw( update_phaidra_url update_urn update_hdl update_doi )
;
# printf ("update_url=[%s] update_urn=[%s] update_hdl=[%s] update_doi=[%s]\n", $update_url, $update_urn, $update_hdl, $update_doi);
if
(
$update_url
||
(
0
&&
$update_urn
)
||
$update_hdl
)
{
my
%out
=
map
{
$_
=>
$row
->
{
$_
}
}
@columns_copy
;
$out
{
url
}
=
$update_url
if
(
defined
(
$update_url
));
$out
{
nbn
}
=
$update_urn
if
(
defined
(
$update_urn
));
$out
{
hdl
}
=
$update_hdl
if
(
defined
(
$update_hdl
));
$out
{
alma_fetched
}
=
$row
->
{
ts_fetched
};
$out
{
hdl
}
=
$row
->
{
hdl
}
unless
(
$row
->
{
val_hdl
}
eq
$row
->
{
hdl
});
# set handle only when not alreadys set...
# print __LINE__, " out: ", Dumper(\%out);
print
TSV_OUT
join
("
\t
",
map
{
$out
{
$_
}
}
@columns_out
),
"
\n
";
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment