Closed rdoughty closed 4 years ago
Ryan, I am unable to reproduce the "error"; I am unable to get output containing the offending "n". Maybe we are dealing with an operating system specific issue?
Could be. That would make sense. I am running this locally on macOS. Are you running this on a *nix system?
Yes, I ran my example on our remote cluster, and it runs Centos.
I believe we are experiencing an operating system issue, and thus, this is a non-issue.
More specifically, I downloaded json2txt.sh, cord.db, and a sample JSON file (de0163ba343bc5ea42399ae8e0b2c76c229a05b6.json). I then ran:
./json2txt.sh de0163ba343bc5ea42399ae8e0b2c76c229a05b6.json
I got the offending output, and I'm running this on my Macintosh too.
I think sed is not the same on my (our) Macintosh as it is on Centos. We don't need to make this work on Macintosh (yet).
If you are comfortable with it, I think we can chalk this up to an operating system specific thing, and we can close this issue.
What do you think?
Sounds good. Closing!
Part of this script parses a json file. The json includes body_text, bibentries, and back_matter fields. After retrieving the value of those fields we attempt to add a newline. I think that is appending the offending 'n'.(see below in the sample output at the end of each 'paragraph').
https://github.com/ericleasemorgan/cord-19/blob/master/bin/json2txt.sh#L60 https://github.com/ericleasemorgan/cord-19/blob/master/bin/json2txt.sh#L64 https://github.com/ericleasemorgan/cord-19/blob/master/bin/json2txt.sh#L68
From my testing this is unnecessary.
But perhaps @ericleasemorgan can provide an example of when this is necessary. I'd either remove it or maybe try...
current sample output example using /export/cord/json/de0163ba343bc5ea42399ae8e0b2c76c229a05b6.json: