Detect the column and row number where whitespace is occuring using Python programmatically -


we coded data based application recently. using python csv module. there whitespace problems in data. using strip() remove whitespaces. fine including calculations.

we got requirement have detect whitespaces , report back. possible detect column no , row no of whitespace in data.

please help.

edit:

operating system

  1. windows 7
  2. ubuntu
  3. " "
  4. fedora

please suppose sample of data. data in row nos. 1, 2 , 3 fine. row 3 doesnt have data has whitespace. want detect this.

if you're using strip, should remove white-spaces. so:

if row.strip() == "" 

would true if row had white spaces:

>>> " \t ".strip() == "" true 

as fetching data csv file, if post code easier help..


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -