How Excel can wrap text in cells as it imports content

Source: Internet
Author: User

In the process of data processing today, in the database used a \ n line-break symbol, the purpose is to do in the same table data multi-line display, such as

Field Name 1 Field Name 2 Field Name 3
1

Data row

Data two rows

Data three rows

The example is the result after the SQL query
2 Example above Data not exported

Originally after the SQL query is so displayed, but later exported text format, Excel from the text import content will be error, then the problem comes,

How to do Excel self-text import content when the cell line wrapping?

Text: On the internet to find a lot of examples, one of the predecessors spoke very reasonable, the following words:

Two essential conditions for Excel to wrap a line
1. Format Excel cells to wrap.
2. Add line break CHAR (10) in the middle of the text

CSV is an ordinary text file that cannot meet the first condition. So the automatic line wrapping function is impossible to implement.

This predecessor of this sentence really let me think carefully, and then according to some examples on the internet, sure enough to let me find a solution:

is to use the SQL string operation to output the above field name 2 under the multiple rows of data as follows:

= "Data row", "Data Two rows", "Data three rows"

After you use Excel to import content from text, the Excel text document displays:

= "Data row", "Data Two rows", "Data three rows"

Finally, the replacement function will be replaced with &char (&), Replaced by = "Data Row" &char (Ten) & "Data two Rows" &char (Ten) & "data three rows" in another cell input = The cell to be wrapped and set it to wrap, and the contents of the cell are what we want.

Cell to Wrap The ideal result
Data row data Two rows of data three rows Data row
Data two rows
Data three rows
= "Data row" &char & "Data two Rows" &char & "data three rows" = Cell to Wrap

End: May not express well, everyone take a good look at the above table, it should be good to understand the point! Rest, it's not too early.

How Excel can wrap text in cells as it imports content

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.