# Any chance of an option to export the map as a CSV where each cell is the tile image name?

**URL:** <https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59>\
**Category:** Suggestions\
**Created:** [November 18, 2014, 12:43am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59 "2014-11-18T00:43:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 18, 2014, 12:43am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/1 "2014-11-18T00:43:32Z")

</div>

The Tiled editor looks great!

I would love it if I could output my map as a CSV file, where each cell is the FILENAME of the image (because that’s what my game engine uses to update each tile as you move around).

Is there any way to get Tiled to output a CSV that looks like this?

tree,grass,mountain,inn,grass,grass,grass,grass,grass,tree,grass,mountain,tree  
tree,grass,mountain,tree,house,mountain,tree,grass,shrubs,tree,grass,grass,tree  
tree,grass,soldier-on-grass,grass,grass,mountain,tree,grass,grass,tree,grass,grass,grass  
tree,grass,grass,grass,grass,grass,mistletoe,grass,mountain,tree,grass,grass,grass

…etc

---

<div class="post-metadata">

**Author:** ![Ablu](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/ablu/32/1496_2.png) [@Ablu](https://discourse.mapeditor.org/u/Ablu)\
**Post date:** [November 18, 2014, 6:08am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/2 "2014-11-18T06:08:55Z")

</div>

You can write your own export plugin for this.

Take a look at [this thread](http://forum.mapeditor.org/t/about-custom-export-formats/656) for more overview about that topic.

Regards,  
Ablu

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 18, 2014, 8:04am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/3 "2014-11-18T08:04:54Z")

</div>

Awesome, thanks! I’ll look into it! 🙂

ACE!

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [November 18, 2014, 8:44am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/4 "2014-11-18T08:44:12Z")

</div>

Just a warning, currently it is only possible to write Python plugins for formats that have both reading _and_ writing implemented. I still need to look into fixing it so that it would be possible to write export-only formats in Python.

C++ plugins do not have this issue.

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 20, 2014, 6:03am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/5 "2014-11-20T06:03:06Z")

</div>

Hello all you lovely Tiled users out there.

**Does anyone happen to feel like writing up an exporter plugin that outputs the map data with the IMAGE FILENAMES for each cell, instead of their ID?**

I wouldn’t know where to start! I’m a game designer!

The game I’m working on simply imports a CSV as the map data. I’ve been using Excel, and saving it as a CSV, which works great. The problem is that it’s not a WYSIWIG editor.

I’d love to use Tiled, so I can see exactly how the world really looks while editing, and benefit from all the nice tile placement functionality of Tiled. Well, actually, my girlfriend is making all the maps, and she would really really love it! 😄

Here’s some screenshots and stuff of our game we’re making. 😄

> **[FutureStateMachine (@futurestatemachine) • Instagram photos and videos](https://www.instagram.com/futurestatemachine/)**
>
> 232 Followers, 603 Following, 218 Posts - See Instagram photos and videos from FutureStateMachine (@futurestatemachine)

---

<div class="post-metadata">

**Author:** ![Ablu](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/ablu/32/1496_2.png) [@Ablu](https://discourse.mapeditor.org/u/Ablu)\
**Post date:** [November 20, 2014, 10:47am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/6 "2014-11-20T10:47:04Z")

</div>

Hi,

why can’t you extend your engine to parse the format that tiled writes (so with ids) rather than your custom format?

Then you will maybe find yourself in a better known development environment.

Also if this is a request for a programmer you should list a full specification of your format… Is it only the tiled csv format (so csv embedded into xml) where the ids are replaced with names? Also how are the names identified? (I mean which tile id is mapped to which name?).

Regards,  
Ablu

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 20, 2014, 11:57pm UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/7 "2014-11-20T23:57:07Z")

</div>

Hi Ablu,

Thanks for your reply!

I’m making the game in an application called GameSalad, which is not extendable in that way (it’s not really extendable in ANY way, unfortunately!).

GameSalad supports the use of tables, which look like this…

![](https://yyz1.discourse-cdn.com/flex035/uploads/default/31/671185dec9523ba5.png)

_…I need to reply in a few parts here, because I can only attach 1 image per post…_

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 20, 2014, 11:57pm UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/8 "2014-11-20T23:57:45Z")

</div>

Tables can only be imported from CSV files, as shown here…

![](https://yyz1.discourse-cdn.com/flex035/uploads/default/32/0387a7eee8b56c87.png)

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 20, 2014, 11:59pm UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/9 "2014-11-20T23:59:58Z")

</div>

I’ve built my game around a system where it reads in a CSV, wherein every cell of the table contains the FILENAME of the image that I want to appear on that cell as the player moves around the game world.

My Excel file looks like this…

![](https://yyz1.discourse-cdn.com/flex035/uploads/default/33/f2782427e0ad37ab.png)

**So for example, the output CSV file looks like this:**

grass, mountain, mountain, grass, grass, house, grass, castle  
grass, mountain, grass, grass, grass, mountain, mountain, grass

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 21, 2014, 12:04am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/10 "2014-11-21T00:04:15Z")

</div>

I save out my Excel table as a CSV file to import into GameSalad. The CSV file looks like this…

![](https://yyz1.discourse-cdn.com/flex035/uploads/default/34/6fda6c8279eae5d1.png)

**That’s the format of the final output that I want to get out of Tiled.**

==============================

For further info about my workflow… I work on the map as an .XLS file, with color coding to make it easier to look at. Each cell is just a FILENAME which matches an image that I have in my game project. It’s quite straight forward, and it works really well.

The only downside is that, when editing the .XLS file, you don’t really get a proper idea of exactly how the world will look, because you’re just looking at a big Excel table! It’s a bit ugly, and when I zoom out of my full map (which is pretty huge), it quite slow to scroll around, etc.

So it’d be great to be able to use Tiled to place all my images (which already have the correct filenames per tile), and output a CSV file that lists all the cells as their image filenames, separated by commas.

If anyone might be up for helping, that would be amazingly helpful. 😄

You can download a copy of my Map.XLS and Map.CSV for reference here:  
[http://www.muzboz.com/Host/MapTable-TileRPG.zip](http://www.muzboz.com/Host/MapTable-TileRPG.zip) (20 kb)

**To summarise, the output CSV would just look like this, with no XML or anything. Just the filenames of each tile that I put into Tiled, written out, separated by commas. ie:**

grass, mountain, mountain, grass, grass, house, grass, castle  
grass, mountain, grass, grass, grass, mountain, mountain, grass

Please do get in touch if you might be able to help. It seems like it’d be quite easy if you know what you’re doing with C++. But I don’t really know where to start, myself!

All the best, and thanks for reading!

Murray  
[www.muzboz.com](http://www.muzboz.com)

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 24, 2014, 12:18am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/11 "2014-11-24T00:18:44Z")

</div>

I really want to tinker with trying to get Tiled to output in the format I want, but I’m a bit new to GitHub, and I don’t understand how to set up the project in Visual Studio. I’d hoped there would be a PROJECT.SLN file included in the GitHub source, but couldn’t find one.

I wonder if the developers of Tiled would be interested in incorporating an option to EXPORT the map, with some customisation options in the EXPORT dialog box, where the user can tinker with the output format. That could be something that many other people find useful, not just myself, and make the tool more versatile for non-programmers.

Any chance of that? 😄

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [November 24, 2014, 8:41am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/12 "2014-11-24T08:41:55Z")

</div>

> [@muzboz](#):
>
> I really want to tinker with trying to get Tiled to output in the format I want, but I’m a bit new to GitHub, and I don’t understand how to set up the project in Visual Studio. I’d hoped there would be a PROJECT.SLN file included in the GitHub source, but couldn’t find one.

There is no Visual Studio project file, but a qmake project file `tiled.pro`. You should install the Qt and open this file in Qt Creator. This process is described at [Contributing to Tiled · mapeditor/tiled Wiki · GitHub](https://github.com/bjorn/tiled/wiki/Contributing-to-Tiled)

> [@muzboz](#):
>
> I wonder if the developers of Tiled would be interested in incorporating an option to EXPORT the map, with some customisation options in the EXPORT dialog box, where the user can tinker with the output format. That could be something that many other people find useful, not just myself, and make the tool more versatile for non-programmers.

Well, I’m definitely interested in at least having a way to add an export format without compiling Tiled yourself, but some programming would still be required. It is almost possible with the recently added Python plugin.

Btw, since your format looks really easy, I will consider writing it. You’re not the only one who has been been requesting support for “CSV” export.

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 24, 2014, 10:57am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/13 "2014-11-24T10:57:13Z")

</div>

Thanks! That’s exciting to hear. If you get a chance to get that working, that’d be excellent. 😄

I’ll check back to see how things are going! Rock on!

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [November 30, 2014, 10:09pm UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/14 "2014-11-30T22:09:45Z")

</div>

I pushed a CSV export format to the master branch, please try if it suits your needs. By default, the tiles are exported by their local tile ID, but if you set a custom property “name” on your tiles then they will be exported by the value of that property.

This change also closed the following issue on github:

> <https://github.com/bjorn/tiled/issues/277>
>
> Would really help with making flixel maps.

I’ve updated the Windows daily builds. Other platforms like Ubuntu PPA and OS X versions should follow soon.

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 30, 2014, 10:22pm UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/15 "2014-11-30T22:22:48Z")

</div>

Awesome! Sounds great, Bjorn. 😄

Do I have to build it from GitHub, or is there a built version?

I’m not sure how to build the GitHub version.

- Murray

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 30, 2014, 10:41pm UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/16 "2014-11-30T22:41:13Z")

</div>

Oh, I see you’ve updated the Windows daily build! Sorry, I missed that note there. I’ll grab it now! 🙂

AWESOME!

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [November 30, 2014, 11:05pm UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/17 "2014-11-30T23:05:17Z")

</div>

Cool! I tried it, and it works. Thanks very much Bjorn!

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [December 1, 2014, 4:38am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/18 "2014-12-01T04:38:28Z")

</div>

I just spent AGES getting my old map to load in Tiled (replacing all the filenames with ID numbers), and finally got it loading, and now when I use Export to CSV, it just outputs numbers, even though my tile-set still has the Custom Properties on it, with the filenames manually added in there.

DANG!

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [December 1, 2014, 4:48am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/19 "2014-12-01T04:48:22Z")

</div>

It’s kind of weird, because it worked fine when I did a quick test to begin with, before loading in my existing map.

---

<div class="post-metadata">

**Author:** ![muzboz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/muzboz/32/28_2.png) [@muzboz](https://discourse.mapeditor.org/u/muzboz)\
**Post date:** [December 1, 2014, 4:51am UTC](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59/20 "2014-12-01T04:51:19Z")

</div>

OK, I figured something had gone wrong since importing my IDs, so I opened the TMX in Notepad++, and did a search and replace on my custom property “filename” and replaced them all with “name”, and now it exports correctly! Dunno why. But phew, seem to have it working now. 🙂

[Next page](https://discourse.mapeditor.org/t/any-chance-of-an-option-to-export-the-map-as-a-csv-where-each-cell-is-the-tile-image-name/59.md?page=2)
