Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other way to clean the output #5

Open
BaptisteRichard opened this issue May 31, 2022 · 0 comments
Open

Other way to clean the output #5

BaptisteRichard opened this issue May 31, 2022 · 0 comments

Comments

@BaptisteRichard
Copy link

I´m using Linux tr fucntion to remove any non-printable characters from the output, then replace any characters between json entites with a comma and add the brackets to make the final output a list of json objects

infile=out.json 
outfile=notes.json
tr -c '[:print:]\t\r\n' '[ *]' < $infile | sed -e 's/}[^{]*{/},{/g' | sed -e 's/}.{/},{/g' | sed -e 's/^[^{]*{/[{/' > $outfile ; echo ']' >> $outfile

Hope it can help someone :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant