pyrss/prompt

39 lines
1.0 KiB
Plaintext

I have a folder "./by_date/" with files named like "2023-02-12.json", "2023-02-13.json", "2023-02-14.json"... structured as follows:
[
{
"id": "c6fd",
"journal": "Journal A",
"title": "Title 1",
"description": "Description for article 1",
"url": "https://www.foo.bar/001",
"tags_from_site": "Tag1, Tag2, Tag3"
},
{
"id": "59a4",
"journal": "Journal A",
"title": "Title 2",
"description": "Description for article 2",
"url": "https://www.foo.bar/002",
"tags_from_site": "Tag4, Tag2, Tag5"
},
{
"id": "94df",
"journal": "Journal B",
"title": "Title 3",
"description": "Description for article 3",
"url": "https://www.bar.foo/003",
"tags_from_site": "Tag1, Tag8, Tag9"
}
]
I want to browse all the files in the folder "./by_date/" and for each file, I want to create a new file in the folder "./tags/" with the same name but without the ".json". In this file, I just want a sorted list of the tags in the form of a plaintext file:
Tag1
Tag2
Tag3
Tag4
Tag5
Tag8
Tag9