Skip to content

Comments

v.report: Fix newline issue#477

Merged
HuidaeCho merged 2 commits intoOSGeo:masterfrom
HuidaeCho:v_report_newline
Apr 21, 2020
Merged

v.report: Fix newline issue#477
HuidaeCho merged 2 commits intoOSGeo:masterfrom
HuidaeCho:v_report_newline

Conversation

@HuidaeCho
Copy link
Member

@HuidaeCho HuidaeCho commented Apr 2, 2020

Issue

If there are newline characters in a column, v.report will fail. I found this issue in the GADM 3.6 dataset.

How to reproduce it in the NC sample dataset

g.copy --o vect=boundary_county,tmp
db.execute sql="update tmp set name='BREAK' || char(10) || 'ME' where cat=1"
v.report map=tmp option=area

will fail.

What does this PR do?

It uses the new -e flag of v.db.select from #476.

@HuidaeCho
Copy link
Member Author

Unescaping escaped newlines and backslashes:

v.report map=tmp option=area | sed 's/\\\\/\x0/g; s/\\n/\n/g; s/\x0/\\/g'

@HuidaeCho HuidaeCho merged commit b74dfd2 into OSGeo:master Apr 21, 2020
@HuidaeCho HuidaeCho deleted the v_report_newline branch April 21, 2020 14:56
@neteler neteler added this to the 8.0.0 milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants