Import a Text File
Confluence allows you to import text files from a directory on the Confluence server, and convert them into Confluence pages. Each file is imported as a separate Confluence page with the same name as the file.
To make sure Confluence maintains the formatting of the text document, add <pre> to the beginning and </pre> to the end. This will let Confluence know that it should treat the text as pre-formatted.
If you're working in a Unix-like environment, you can add the opening and closing tags to all files in a particular directory by following these steps:
- Go to the directory containing the files
- Run the following command in the terminal:
To import text files:
- Go to the space and choose Space tools > Content Tools from the bottom of the sidebar
- Choose Import
- Type the directory path into the Import directory box
- Select Trim file extensions to remove file extensions from the page titles when converting the files to Confluence pages
The Confluence pages will take their titles from the files' names (including their extensions). To avoid having page titles with a suffix like '.txt' check this box.
- Select Overwrite existing pages if you want to replace existing Confluence pages with the same title with the one you're importing
- Choose Import
If your space uses the Documentation theme:
- Choose Browse > Space Admin from the header
Note: The Space Admin option appears only if you have space admin permissions, or if you're part of the 'confluence-administrators' group.
- Choose Import from the space administration options
- Follow the steps above
Confluence will place the new pages at the root of the space.
Screenshot: Importing text files
Was this helpful?
Thanks for your feedback!