Skip to content

Other way to clean the output #5

Open

Description

@BaptisteRichard

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 :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions