[GIS] Converting .shp file to .csv file using ogr2ogr

csvogr2ogrshapefile

I want to covert the .shp file to .csv file by using ogr2ogr
and I am running

PGCLIENTENCODING=UTF8 ogr2ogr -f CSV "/home/pj/Desktop/test1.csv" "/home/pj/Desktop/20160705102900718.shp"

but the shell prompt

ERROR 4: Unable to open /home/pj/Desktop/20160705102900718.shx or /home/pj/Desktop/20160705102900718.SHX.
FAILURE:
Unable to open datasource `/home/pj/Desktop/20160705102900718.shp' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
  -> SDTS
  -> TIGER
  -> S57
  -> DGN
  -> VRT
  -> REC
  -> Memory
  -> BNA
  -> CSV
  -> NAS
  -> GML
  -> GPX
  -> LIBKML
  -> KML
  -> GeoJSON
  -> Interlis 1
  -> Interlis 2
  -> GMT
  -> SQLite
  -> DODS
  -> ODBC
  -> PGeo
  -> MSSQLSpatial
  -> OGDI
  -> PostgreSQL
  -> MySQL
  -> PCIDSK
  -> XPlane
  -> AVCBin
  -> AVCE00
  -> DXF
  -> Geoconcept
  -> GeoRSS
  -> GPSTrackMaker
  -> VFK
  -> PGDump
  -> OSM
  -> GPSBabel
  -> SUA
  -> OpenAir
  -> PDS
  -> WFS
  -> HTF
  -> AeronavFAA
  -> Geomedia
  -> EDIGEO
  -> GFT
  -> SVG
  -> CouchDB
  -> Idrisi
  -> ARCGEN
  -> SEGUKOOA
  -> SEGY
  -> XLS
  -> ODS
  -> XLSX
  -> ElasticSearch
  -> PDF
]

Best Answer

A shapefile consists of a bunch of files. The .shp and .shx are mandatory, .dbf and .prj are necessary for some tasks as well.

The error message notes that the .shx file for your .shp file is missing. If you rename the .shp file to match the naming conventions, make sure to rename the .shx file as well.