how to import txt file as entries?

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
juraganposter
Posts: 1
Joined: Fri Jul 15, 2022 4:36 pm

how to import txt file as entries?

Post by juraganposter » Fri Jul 15, 2022 4:40 pm

hi guys,

i have thousands of txt file that i want to import as entries,
how to do that?

thank you :)

User avatar
Arvid
FlatPress Coder
Posts: 558
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: how to import txt file as entries?

Post by Arvid » Wed Jul 27, 2022 12:39 pm

Hi and welcome to FlatPress :)

When you install an example FlatPress instance, you can inspect its content structure quite easily. All your content - images, files, entries, pages; also settings - is stored under fp-content/.
If you want to import a blog entry from, say, Christmas 2012, you would need to create the file fp-content/content/12/12/entry121225-080000.txt (given its timestamp should be Dec 25 2021 08:00:00).
This entry file then contains the entry metadata and the content. See bttr's great howto on the FlatPress file formats on the wiki: https://wiki.flatpress.org/doc:tech:fileformats

After creating all the files, don't forget to rebuild the FlatPress index (Admin Area -> Maintain).

Maybe you find the existing importers quite useful as a start, you find them in our flatpress-extras repository on GitHub: https://github.com/flatpressblog/flatpr ... r/fp-tools

Let us know if that helped!
All the best
Arvid

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests