# JSON Files

**URL:** https://community.mp3tag.de/t/json-files/16909
**Category:** General Discussion
**Created:** [May 19, 2015, 6:28pm UTC](https://community.mp3tag.de/t/json-files/16909 "2015-05-19T18:28:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jackpots](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/82dd89/32.png) [@jackpots](https://community.mp3tag.de/u/jackpots)
#### Post date: [May 19, 2015, 6:28pm UTC](https://community.mp3tag.de/t/json-files/16909/1 "2015-05-19T18:28:58Z")

</div>

Is it possible for Mp3tag to …

1. Save locally the files obtained from the TagSources queries?

2. Can it read local (not http served) json files within the TagSources process?

I am aware it would need to be scripted, however, is it possible?

---

<div class="post-metadata">

### Author: ![vkostas](https://community.mp3tag.de/user_avatar/community.mp3tag.de/vkostas/32/227_2.png) [@vkostas](https://community.mp3tag.de/u/vkostas)
#### Post date: [May 20, 2015, 2:15pm UTC](https://community.mp3tag.de/t/json-files/16909/2 "2015-05-20T14:15:53Z")

</div>

1. Yes, with debugger option (t keeps only the last file though).
2. No. A workaround is to install php server and to access the stored files from there.

---

<div class="post-metadata">

### Author: ![jackpots](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/82dd89/32.png) [@jackpots](https://community.mp3tag.de/u/jackpots)
#### Post date: [May 20, 2015, 2:27pm UTC](https://community.mp3tag.de/t/json-files/16909/3 "2015-05-20T14:27:05Z")

</div>

> [@Victor Kostas](#):
>
> 1. Yes, with debugger option (t keeps only the last file though).
> 2. No. A workaround is to install php server and to access the stored files from there.

Thanks.

I found a JSON Server on GitHub ([GitHub - typicode/json-server: Get a full fake REST API with zero coding in less than 30 seconds (seriously)](https://github.com/typicode/json-server)) that may do the trick for #2. I haven't tested it as yet though.

My intention is to use this as a local backup/restore of tags (many many tracks worth over many many years from many disparate sources which I could not easily reconstitute). Mp3tag needs an option to read csv headers or import json files or similar.

Thanks again.

---

<div class="post-metadata">

### Author: ![vkostas](https://community.mp3tag.de/user_avatar/community.mp3tag.de/vkostas/32/227_2.png) [@vkostas](https://community.mp3tag.de/u/vkostas)
#### Post date: [May 20, 2015, 3:11pm UTC](https://community.mp3tag.de/t/json-files/16909/4 "2015-05-20T15:11:50Z")

</div>

> [@jackpots](#):
>
> Thanks.
> 
> I found a JSON Server on GitHub ([GitHub - typicode/json-server: Get a full fake REST API with zero coding in less than 30 seconds (seriously)](https://github.com/typicode/json-server)) that may do the trick for #2. I haven't tested it as yet though.
> 
> My intention is to use this as a local backup/restore of tags (many many tracks worth over many many years from many disparate sources which I could not easily reconstitute). Mp3tag needs an option to read csv headers or import json files or similar.
> 
> Thanks again.

Well, you can backup your tags. Search the forum and you will find info.  
You can import tags from text file. Each line contains tags of a single track.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 20, 2015, 3:39pm UTC](https://community.mp3tag.de/t/json-files/16909/5 "2015-05-20T15:39:56Z")

</div>

> [@Victor Kostas](#):
>
> Well, you can backup your tags. Search the forum and you will find info.  
> You can import tags from text file. Each line contains tags of a single track.

I would like to add a little more specific information to that:  
for exports ther is the $list function that outputs the contents of all fields of a file to the report file.

For fields that contain linebreaks you have to devise a special treatment as the linebreaks would violate the csv-format which requires a single line for each record. The linebreak is in fact the end-of-record marker. E.g. UNSYNCEDLYRICS very often has linebreaks.

If you have various sets of fields in the different files, you will have difficutlties with the $list function as you will not get a proper csv file.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [May 20, 2015, 4:41pm UTC](https://community.mp3tag.de/t/json-files/16909/6 "2015-05-20T16:41:21Z")

</div>

> [@jackpots](#):
>
> ... My intention is to use this as a local backup/restore of tags ... Mp3tag needs an option to read csv headers or import json files or similar. ...

You can use Mp3tag export feature to write tag-field content to text file.  
For example, create an export script and apply a code line like the following ...

**$char(9)'{'$regexp($regexp($regexp($regexp($list('"','": "','",'$char(13)$char(9)$char(10)),'\r\n','U+000DU+000A'),'\r\t\n','\r\n'),'\\\\','\\\\'),',\Z',)'}'**

... maybe escaping of the double-apostrophe must be worked in additionally.

DD.20150520.2041.CEST
