Skip to content

Commit

Permalink
Add and update steps to _parse_line method to allow processing of usa…
Browse files Browse the repository at this point in the history
…ge data from TR_J1 reports
  • Loading branch information
yannsta committed Aug 25, 2020
1 parent a481276 commit 5791a3e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pycounter/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,9 +780,9 @@ def _parse_line(line, report, last_col):
metric = report.metric
if (
report.report_type.startswith("JR1")
or report.report_type == "TR_J1"
or report.report_type == "TR_J2"
):

old_line = line
line = line[0:3] + line[5:7] + line[10:last_col]
doi = old_line[3]
Expand All @@ -791,8 +791,15 @@ def _parse_line(line, report, last_col):
pdf_total = format_stat(old_line[9])
issn = line[3].strip()
eissn = line[4].strip()
if report.report_type.startswith("TR"):
metric = old_line[9]

elif report.report_type in "TR_J1":
old_line = line
line = line[0:2] + line[3:4] + line[6:8] + line[11:last_col]
doi = old_line[4]
metric = old_line[9]
prop_id = old_line[5]
issn = line[3].strip()
eissn = line[4].strip()

elif report.report_type in ("BR1", "BR2"):
line = line[0:3] + line[5:7] + line[8:last_col]
Expand Down

0 comments on commit 5791a3e

Please sign in to comment.