<div dir="ltr"><div>Hi Micha,</div><div><br></div><div>It worked! I only had to make a minor change to process all inside grass. So for future reference, what I did was:</div><div><br></div><div>db.execute sql='update solos set horizonte = replace(horizonte, char(10), " ")'</div><div><br></div><div>I could not use the line break in the db.execute sql statement. But I found that char(10) is the same thing [1].</div><div><br></div><div>Cheers</div><div>Daniel</div><div><br></div><div>[1] - <a href="https://stackoverflow.com/questions/23930865/new-line-character-n-in-sqlite-concatenate">https://stackoverflow.com/questions/23930865/new-line-character-n-in-sqlite-concatenate</a><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 3, 2018 at 5:53 PM Micha Silver <<a href="mailto:tsvibar@gmail.com">tsvibar@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="direction:ltr" text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="m_4058933410725688177moz-cite-prefix">On 07/03/2018 10:39 PM, Daniel Victoria
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hi list,</div>
<div><br>
</div>
<div>Sorry to resurface an old problem. At the time I was able
to 'circle around' this 'inconsistent number of column' issue.
But now it came back (like all good problems do).</div>
<div><br>
</div>
<div>Anyway, I imported a large soil map with v.in.ogr, whitout
errors. But when I try to open the attribute table (Show
attribute table in GUI dialog), I get an error saying "<span class="m_4058933410725688177inbox-inbox-lG">Inconsistent</span> number of column
in the table". The Attribute table manager then opens but I
can't browse the data.</div>
<div><br>
</div>
<div>v.db.select on the CLI works fine so I suspect it's a
problem with special characters in the attribute table messing
up with the attribute table GUI.</div>
<div><br>
</div>
<div>The data has lots of special characters (accents) and they
show up fine in v.db.select. But I suspect the main problem is
that the attribute table has line breaks! Yes, someone has
placed line brakes in the attribute table. Yikes...</div>
<div><br>
</div>
<div>Any idea how to clean this attribute table? The only thing
I could think of is opening the shapefile in R or Python and
try to substitute the "\n" character.</div>
<div><br>
</div>
</div>
</blockquote>
</div><div style="direction:ltr" text="#000000" bgcolor="#FFFFFF"><font size="+1">I think you can do this straight in sqlite (assuming
your backend db for this vector is sqlite) using the builtin sql
function replace().<br>
Here's an example:<br>
<br>
</font><font size="+1"><tt>sqlite> create table t1 (id integer
primary key, label text);</tt><tt><br>
</tt><tt>sqlite> insert into t1 (label) values ('ab</tt><tt><br>
</tt><tt> ...> cd');</tt><tt><br>
</tt><tt>sqlite> insert into t1 (label) values ('xyz</tt><tt><br>
</tt><tt> ...> abc');</tt><tt><br>
</tt><tt>sqlite> </tt><tt><br>
</tt><tt>sqlite> select * from t1;</tt><tt><br>
</tt><tt>1|ab</tt><tt><br>
</tt><tt> cd</tt><tt><br>
</tt><tt>2|xyz</tt><tt><br>
</tt><tt> abc</tt></font><br>
<br>
<font size="+1">Now the replace trick: </font><br>
<br>
<font size="+1"><tt>sqlite> update t1 set label=replace(label, '</tt><tt><br>
</tt><tt> ...> ', '');</tt><tt><br>
</tt><tt>sqlite> select * from t1;</tt><tt><br>
</tt><tt>1|ab cd</tt><tt><br>
</tt><tt>2|xyz abc</tt><tt><br>
</tt><tt>sqlite> </tt></font><br>
<br>
HTH</div><div style="direction:ltr" text="#000000" bgcolor="#FFFFFF"><br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>Cheers</div>
<div>Daniel<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue, Jan 16, 2018 at 10:13 PM Daniel Victoria
<<a href="mailto:daniel.victoria@gmail.com" target="_blank">daniel.victoria@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
<div>That is probably the case.<br>
Is there a way to 'sanitize' this shapefile DBF prior to
v.in.ogr?<br>
<br>
Or the fact that v.db.select works on the CLI means that
the attribute table is OK. It's more a visualization
problem with the GUI attribute table manager.<br>
<br>
</div>
Thanks<br>
</div>
</div>
<div dir="ltr">Daniel<br>
<div>
<div>
<div><br>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue, Jan 16, 2018 at 6:15 PM Helmut
Kudrnovsky <<a href="mailto:hellik@web.de" target="_blank">hellik@web.de</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">DanielV
wrote<br>
> Hi List,<br>
><br>
> I imported a large vector shapefile into grass.
v.in.ogr did not report<br>
> any<br>
> errors. However, when I try to open the attribute
table (Show attribute<br>
> table in GUI dialog), I get an error saying
"Inconsistent number of column<br>
> in the table". The Attribute table manager then opens
but I can't browse<br>
> the data. However, table is correctly described
(column names and data<br>
> type).<br>
><br>
> From the CLI, v.db.select will print the contents of
the attribute table<br>
> without any complains.<br>
><br>
> Any idea how to troubleshoot this?<br>
<br>
are there any special characters in the table content,
e.g. ' or " or ; or ,<br>
or / or \ .... etc?<br>
<br>
<br>
<br>
-----<br>
best regards<br>
Helmut<br>
--<br>
Sent from: <a href="http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html</a><br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a></blockquote>
</div>
</blockquote>
</div>
<br>
<fieldset class="m_4058933410725688177mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
grass-user mailing list
<a class="m_4058933410725688177moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>
<a class="m_4058933410725688177moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a></pre>
</blockquote>
<br>
</div><div style="direction:ltr" text="#000000" bgcolor="#FFFFFF"><pre class="m_4058933410725688177moz-signature" cols="72">--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918</pre>
</div></blockquote></div></div></div>