How can I keep paragraphs of text in one cell when i import data from a CSV file without it making it all one big paragraph? I'm using Migrate, Migrate Tools, Migrate CSV to import data from a csv file into my website.
One field I have is Text (Formatted, Long), and this is where I import a bunch of information about my specific item.
If in my csv file I write out something like this in a cell (Using Alt+Enter to create a line break in the cell):
This is paragraph 1 of a block of text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut optime, secundum naturam affectum esse possit. Tu autem, si tibi illa probabantur, cur non propriis verbis ea tenebas? Sine ea igitur iucunde negat posse se vivere? Quod autem satis est, eo quicquid accessit, nimium est;
This is paragraph 2 of a block of text. Duo Reges: constructio interrete. Non enim quaero quid verum, sed quid cuique dicendum sit. Quod quidem iam fit etiam in Academia. Cum ageremus, inquit, vitae beatum et eundem supremum diem, scribebamus haec.
It ends up importing like this into Drupal:
This is paragraph 1 of a block of text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut optime, secundum naturam affectum esse possit. Tu autem, si tibi illa probabantur, cur non propriis verbis ea tenebas? Sine ea igitur iucunde negat posse se vivere? Quod autem satis est, eo quicquid accessit, nimium est; This is paragraph 2 of a block of text. Duo Reges: constructio interrete. Non enim quaero quid verum, sed quid cuique dicendum sit. Quod quidem iam fit etiam in Academia. Cum ageremus, inquit, vitae beatum et eundem supremum diem, scribebamus haec.
Just one big block of text.
Does anyone know of anything special that I need to put into my Excel cell after each paragraph so that Drupal knows to break up each paragraph into its own &lt;p&gt; paragraph tag once imported from the saved .csv file?
I've gone through numerous sites/threads trying to find an answer but I can't quite seem to find anything explaining what I need to do in Excel prior to exporting as CSV to maintain the paragraph breaks.
Note, after I export from excel to csv, i open the file in Notepad and resave as UTF-8 in order to import the content properly in Drupal.
Is this something that is even possible at all?
If your CSV file is saved with new line characters then I expect it is also saved that way into the database. You can check this if you have access to the database. But you can also check this more or less on the Edit page of some of the content that has been imported.
Drupal uses Text formats to display the text. This means it can change what is being served from the database.
Check which Text format is being used on that field and then check the configuration for that format. You can check which Text format is being used on the Edit page, right below the text area element.
&quot;Losing&quot; new line characters can happen if you don't have a Convert line breaks into HTML (i.e. &lt;br&gt; and &lt;p&gt;) option turned on on the format that you apply to your field.
Try using that option on the Text format of the content you've imported, or maybe you have the &quot;Plain text&quot; format, since you're importing content, but make sure that this format has the option Convert line breaks into HTML (i.e. &lt;br&gt; and &lt;p&gt;) enabled.
You can find Text formats under Configuration &gt; Content authoring &gt; Text formats and editors.
Just make sure you don't save the node with a Text format chosen that doesn't have that option enabled (you will see all the paragraphs lumped together), because saving the node will override what is written in the database. Don't save if it doesn't look good, and try to find which Text format makes it look good, it will probably be the one that has the mentioned option enabled ;)