• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Line Break in CSV|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Line Break in CSV|General Excel Questions & Answers|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Line Break in CSV
sp_PrintTopic sp_TopicIcon
Line Break in CSV
Avatar
Kevin Junk
Member
Members
Level 0
Forum Posts: 23
Member Since:
October 18, 2018
sp_UserOfflineSmall Offline
1
April 21, 2019 - 9:55 am
sp_Permalink sp_Print

This isn't strictly an Excel issue but there's a lot of talent on this forum and I thought that someone may have a solution.

I need to migrate data from SQL Server to Salesforce using csv files (unfortunately I'm stuck with csv). In one of my transformations I create a derived column from the values within several other columns, resulting in a 'long text' column (let's call this derived column 'AggText').

So for example say AggText is derived by concatenating the values from the columns Name, City and Gender: one record for Aggtext might be, say, 'Jack-Paris-male' (but ultimately I don't want the components to be separated by dashes - read on).

Once inserted into Salesforce I want the components of AggText to be on separate lines, so in the previous example the data on the page layout would look like this:

Jack
Paris
male

The problem is I can't get those components to end up on separate lines. I've tried various combinations of double quotes, single quotes, line feed characters, carriage return characters etc - no good. If I was starting with the csv then I would just use an 'Alt-Enter' at the end of each component, but starting with SQL Server I can't get any line break to come through to Excel.

My only solution (and its a bit agricultural) is to insert a character between the components that is unlikely to be in the data (say, the '^' character) and once the data is in Excel I do a global replace of that character with ctrl+j (ie. line feed). I'd rather not have to do this extra step at all.

Has anyone done this successfully before?

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4518
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
April 21, 2019 - 11:55 am
sp_Permalink sp_Print

Hi Kevin,

Once you've merged the columns with the hyphen, select the merged column > Transform tab > Replace Values. In the Advanced Options check 'replace using special characters' > Line Feed (see image below):

kevin_pq_linefeed.pngImage Enlarger

When you close & load to Excel you'll need to format the column with 'Wrap Text' so that the line feed is executed.

Mynda

sp_PlupAttachments Attachments
  • sp_PlupImage kevin_pq_linefeed.png (11 KB)
Avatar
Kevin Junk
Member
Members
Level 0
Forum Posts: 23
Member Since:
October 18, 2018
sp_UserOfflineSmall Offline
3
April 25, 2019 - 1:51 pm
sp_Permalink sp_Print

Hi Mynda

I'm not sure what you mean by "select the merged column > Transform tab ...". I'm on Excel 2010 so I don't have a Transform tab, and my Find/Replace function doesn't feature the advanced options you mention.

The point though was to see how I could make this happen within SQL Server and I guess its just one of things that can't be done until MS puts their mind to it.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Aminu Sule
Samuel Ramirez
Abdifatah Osman
mohad borhom
Abayomi Adedeji
Ganesh MVS
Gilbert Lemek
Ashleigh Farquharson
Jayz Luu
Fred Smith
Forum Stats:
Groups: 3
Forums: 24
Topics: 6364
Posts: 27828

 

Member Stats:
Guest Posters: 49
Members: 32346
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.