[GRASS-dev] [GRASS GIS] #1633: Unable to display shapefile attribute table due to pipe characters in dbf field

GRASS GIS trac at osgeo.org
Mon Apr 15 04:20:05 PDT 2013


#1633: Unable to display shapefile attribute table due to pipe characters in dbf
field
--------------------------+-------------------------------------------------
  Reporter:  richardc     |       Owner:  grass-dev@…              
      Type:  defect       |      Status:  reopened                 
  Priority:  critical     |   Milestone:  6.4.3                    
 Component:  wxGUI        |     Version:  svn-releasebranch64      
Resolution:               |    Keywords:  database, separator      
  Platform:  Unspecified  |         Cpu:  Unspecified              
--------------------------+-------------------------------------------------

Comment(by hamish):

 Hi,

 sorry I am coming to this a bit late. Could someone explain/provide the
 command line and parsing that the gui does which causes this? ie why is it
 a problem on Windows an no where else? is v.db.select outputting with
 fs='|', but '|' is also in the data, so too many columns in the output?

 From a quick read of the report it sounds like as long as varchar() can
 contain all readable chars <=127, and fs= can be all readable chars <=127,
 then changing the fs= from some to another obscure char is always going to
 be a problem for some data which contains that char. How about if fs= some
 >128 char which varchar() doesn't support?

 {{{
 SEP=`echo -e "\xB7"`
 v.db.select roads fs="$SEP"
 }}}

 then .split() on char 183? or might the varchar() string contain that too?


 Is the problem because we are using text files as the intermediary format?
 and not like xargs's -0 to use the null char as the f.sep.?


 or could the python csv library help? It's a similar tricky quoting
 problem for reading csv when the string can contain a comma.
 http://docs.python.org/2/library/csv.html


 ?,
 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1633#comment:12>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list