3

I have a csv that looks like this:

original format

After I convert the csv to a shape file in QGIS, edit it in QGIS (clip), then export it as a csv, the output looks like this:

After export:

What do I need to do to reduce the data but keep the original data format?

5
  • 1
    Did you open the CSV in Excel (I mean the screenshot)?
    – GforGIS
    Commented Mar 26 at 3:21
  • Yes the csv screenshots are both opened in excel Commented Mar 26 at 3:24
  • 1
    You should perhaps change the cell format in excel: support.microsoft.com/en-gb/office/… . You could also customs the cell format by accessing the cell properties dialog box ctrl key + 1
    – GforGIS
    Commented Mar 26 at 3:32
  • Thankyou but I have lost data during the QGIS process, changing the format after that process won't bring it back. Or do you mean before editing in QGIS? Commented Mar 26 at 3:34
  • Let me see if I can replicate the issue.
    – GforGIS
    Commented Mar 26 at 3:38

1 Answer 1

6

I believe the issue is with the dbase file that does not support your format.

I have created some dummy data

enter image description here

and loaded the csv file into QGIS (loading data form CSV).

enter image description here

Converted the layer to Shapefile, Geopackage and file Geodatabase. When openeing the attribute tables, I noticed that the Shapefile had removed UTC, the Geopackage had kept it and the File Geodatabase had converted the time to current time adding the UTC into the original time (it kept the date the same).

enter image description here

When exporting the layers into CSV, the Geopackage format is the only one that kept the format close to your original format, you may have to touch up a bit on the format in Excel.

enter image description here

Would you consider changing format to Geopackage?

An alternative wold be to look into changing the time zone within QGIS: Changing timezone of features attribute

2
  • 1
    Great bit of investigation. Another reason to avoid shape files!
    – she_weeds
    Commented Mar 26 at 8:11
  • 1
    Brilliant work GforGIS! Thanks so much for your time and expertise. It was solved by changing the date time to dd/mm/year h:mins Commented Mar 26 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.