Merge multiple Text Files
If we want to stick several text files together to create one united file from the individual files, we could go the difficult way: We could open each individual text file one after the other in an editor, we could copy each content of each of the files individually, in order to insert them into a new file among each other. For a few files, this might be practical, but what if we had to do this task for very many files?
In this tutorial, we therefore show you an easy way, how you can concatenate any number of files without any problems and without much effort. We use the TextConverter for that task, with which you are also able to simultaneously edit the files as required. The program supports all types of text files, so you can use this tutorial for text files with any text as well as, for example, for CSV files or other formats that can be lined up.
General Procedure
Before we go into detail, we would first like to look at the general procedure how you can hang together files with the TextConverter:
- First, add all the files you want to join to the file list in the TextConverter. To do this, you can simply drag the files from any folder from the Explorer onto the program.
- Then activate the option "Join Files" on the right under "Actions > Files". You should now already see the result of the junction in the preview.
- If you are satisfied with the result, click on the button "Convert and Save". This saves the result as a file. You can determine the name and the folder for storing this file in the area "Storage Options".
That's it. These 3 simple steps are sufficient to put together any number of files with the TextConverter.
Let's now look at the details and the other options with which you can influence the result:
- Order of the Files
- Options for the Junction
- Application of other Actions
- Insert Line Breaks or Text before, between and behind the Files
- Split a Text File into several new Text Files
Order of the Files
It is crucial for a satisfactory result that the files are hung together in the correct order. The order of the combined files always corresponds to the order of the files in the file list. This means that you should make sure that the files are assembled in the correct order in the file list before connecting them.
You can either add the files directly to the file list in your desired order or you can change the order of the files in the list after adding. Single files can be moved with the mouse to another position in the list. The order of all files can easily be changed by clicking on a column heading. This allows you to sort the files according to their name, their size or by other criteria in order to use this order directly for your junction.
Options for the Junction
The following options for the concatenation of the files are available. You can easily activate or deactivate them via the checkboxes:
- Remove whitespace from the beginning or from the end of each file: With these options you can delete possible whitespace from the beginning or from the end of the individual original files before joining them. If an original file begins or ends, for example with tabs, spaces or line breaks, these characters are removed and only the actual text of the file is joined.
- Perform actions before or after merging: With these options you determine whether possible other actions should be applied before or after the files are united. You can find out more about that in the section "Application of other Actions".
- Insert line break between the files: If this option is activated, a simple line break is inserted between each of the individual files. This option can be used, for example, if your original files do not end or start with whitespace and you want to prevent words from finding together that do not belong together. This option is also useful if you want to join several CSV files, so that the first line of the next file appears directly as a new line under the last line of the previous file.
- Insert text before, between or behind the files: In addition to the possibility of inserting a simple line break between the files, these options offer the possibility of combining the content of the individual files with any, also multi-line, texts. As part of these options, 3 different texts can be defined: One text that is inserted in front of the files at the beginning, one text that is inserted at the end of all files and one text that is inserted between the files. You can find out more about that in the section "Insert Line Breaks or Text before, between and behind the Files".
- Show preview for each file individually: In contrast to the other options, this last option does not influence the result of the merging. Instead, you can change the preview mode with this option. If the option is deactivated, the preview shows the joined text composed of all files, so the preview corresponds to the result of how the new file will actually look like later. If the option is activated, the preview only displays the text of one individual file, which is the file which is currently selected in the file list - even if it is later saved differently. This option is particularly useful if you want to combine a lot of files and you have additionally activated other actions and it is therefore difficult to find the effect of the actions on a specific individual file in the preview in the long resulting text.
Application of other Actions
The action "Join Files" can be combined with any other actions from the TextConverter. This includes, for example, actions for text processing, actions for line editing or actions for CSV editing. With the options "Perform actions before merging the files for each file individually" as well as "Perform actions after merging the files", you can determine whether these other actions should be carried out as a first step before the combination of the files on the individual files and/or after the joining on the resulting united file.
This option is particularly important for actions that relate either to a specific character position in the text or to a specific line (defined by a line number) in the text. That is because, the character positions and the line numbers change by merging the files. For example, if you activate a line action that should be applied in the first line, before the merging, each individual file has a line number 1. However, after the joining, only the line numbers of the first file match the line numbers of the original files. All other files can only be addressed via an ongoing line number. Depending on which goal you have, it can therefore be better to carry out the actions either before or after merging.
Of course, the function for interconnecting files can also be used alone and does not have to be combined with any other actions. Perhaps it is also sometimes and depending on the task a good idea for you to edit the files before or after joining in a separate step with the TextConverter instead of doing everything at once.
Insert Line Breaks or Text before, between and behind the Files
When connecting and combining files, inevitably the question arises whether the beginning of a new file in the row fits seamlessly to the end of the previous file. In the worst case, a file ends with a word that should not be connected to the first word of the next file. In order to prevent such problems, the TextConverter provides the option of inserting an arbitrary text between the individual files so that the transition succeeds smoothly. In addition, other texts that can differ from the intermediate text can be defined, which are written in front of or behind the series of files.
To only insert a simple line break between the files, you can simply activate the option "Insert line break between the files" with one click. If it should become more individual, you can use the three options "Insert text before the files", "Insert text between the files" and "Insert text behind the files". These provide the possibility of defining three texts for the beginning, for the end and as a gap filler between the files. The texts may also have multiple lines, so you can also use the corresponding text boxes to write one or more line breaks between the files by simply writing line breaks into the respective box. The text for the begin is only used once at the beginning. The text for the end is also only used once for the ending. The text for between the files is used several times, between all 2 files, so the number depends on the number of files that are to be put together. For two files, the text is used once between the two files, for three files twice between the first and the second and between the second and the third file and so on.
If you want to write a text before, between or behind the files, the wide range of placeholders provided by the TextConverter, can also be interesting for you. For example, you can avail yourself of the offering of the placeholders for the file name. If you write, for example, the placeholder %filename% or %name% into the corresponding text fields, perhaps combined with a few line breaks above or below, you can insert the file name with file path (%filename%) or without file path (%name%) before and between the files and thus mark, from which original file the upcoming text comes from. With the placeholders for numbering files, you can also number your merged files. For example, with "%num%/%abs%" you can insert the number of the file in the file list (%num%) as well as the absolute number of files in the file list (%abs%). Of course, these are only examples, the placeholders can of course also be combined with each other or used together with any other characters.
Split a Text File into several new Text Files
The opposite of the fusion of multiple text files for creating one single new file out of the single files is the splitting of one text file into several new individual files. This function can also be carried out with the TextConverter. You can find out how that works in the tutorial about dividing a text file into several new text files.