How to export the cell that contains new line character properly?

26 views
Skip to first unread message

Alexander Luya

unread,
Sep 6, 2016, 6:53:15 AM9/6/16
to OpenRefine

I have a row of data as below. The problem is that it will be exported as three rows in csv file; how do I export it as one row?

    ________________________________________________________________________________________
    |id              |exception
    --------------------------------------------------------------------------------------
    |cell_1_content  |hash*app_version*..is not enabled.
    |                |   at android.app.ActivityThread.deliverResults(ActivityThread.java:2982)
    |                |   at android.app.ActivityThread.handleSendResult(ActivityThread.java:3025)
    |                |   at android.app.ActivityThread.access$1100(ActivityThread.java:123)
     ______________________________________________________________________________________

Owen Stephens

unread,
Oct 6, 2016, 8:49:25 AM10/6/16
to OpenRefine
It may depend on the outcome you want, and also what software you are going to use to read the csv. However, my suggestion would be to replace the newlines in the cell with a different delimiter.

So e.g in the 'exception' column do a transform using something like:

value.replace(/\n/,"|")

Owen
Reply all
Reply to author
Forward
0 new messages