Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

My computer will not open a project i have been working on for weeks! it is coming up with an error of

Project file read error: unexpected end of file at line 1 column 1 for file C:/Users/xxxx/Documents/Nxxxx/Exxxx.qgs

Is there anyway to get it back?

share|improve this question
Was this file made with an earlier version of QGIS? I have had problems opening older files after upgrading Quantum. –  s_a Sep 13 '12 at 14:20
You can also look at the project file, since it is text based (XML). –  lynxlynxlynx Sep 13 '12 at 14:26
How do i look up the project file? It was created on an earlier one but think it crashed when i tried to save. –  Gerald Sep 13 '12 at 14:37
Just follow the path mentioned in the error path. The file is a text file, so you can open it with any text editor. I'm using notepad++ for such things. once installed, you can open every file with it by right-clicking in the explorer. –  AndreJ Sep 13 '12 at 17:18

3 Answers 3

up vote 3 down vote accepted

Just encountered same problem (error while saving, couldn't reopen project) and mostly resolved it --> Open your .qgs project file with a text editor (e.g. notepad, notepad++, textedit) and it should show the xml markup.

The 'unexpected end of file' is because the application did not finish saving the end of the document, and so there are xml tags that were not closed. Add closing tags where needed, for example my file needed: /maplayer /projectlayers properties /properties /qgis

It will be easier if you can open a project file that is working with notepad as well to compare the differences.

hope this helps.

share|improve this answer

I have encountered this error before and it has just occurred again. QGIS crashed before my project could be saved. When I attempted to re-open the project I got the same error as above. The project file was empty (0k).

I found the actual project data was stored in a file (which may be hidden on your system - if so, you need to enable view hidden files) with the same project name, but called yourfilename.qgs~.

To recover, I opened the .qgs~ file in Wordpad and then saved it immediately as the .qgs file, overwriting the empty .qgs file. I closed Wordpad, launched QGIS and reopened the project - no problem.

Using Windows 7 home 64bit and QGIS 2.4.0 64 bit.

share|improve this answer
You just saved me a lot of time! Any idea why it happens? –  H.Wiener Dec 1 '14 at 11:55
Me too - great answer. –  Ben Mayo Dec 16 '14 at 13:52

Your data is not in the .qgs file, but in shapefiles or spatialite databases you added to the project. So your data is not lost.

You can always create a new project, and add the same layers as before. Only styling may be lost. You can save that too in a file, if it is worth saving.

share|improve this answer
I know this. it is just that there is an amount of data that i do not wish to have to rebuild. which is what i ended up doing in the end. –  Gerald Oct 16 '12 at 9:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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