+ Reply to Thread
Results 1 to 3 of 3

Adding CHAR(10) to add line breaks causes speech marks to be added

Hybrid View

  1. #1
    Registered User
    Join Date
    03-13-2020
    Location
    UK
    MS-Off Ver
    2016
    Posts
    1

    Adding CHAR(10) to add line breaks causes speech marks to be added

    I have what appear to be a simple problem - yet a solution is proving rather elusive!!

    I have a spreadsheet which generates 4 lines of configuration. Presently, I have to take the resulting text from each cell - and paste it in line by line. I thought it would be easier to generate a single string with Carriage Return (CR) characters so I could paste all lines in one go. However, When I add the CHAR(10) CR character - it adds speech marks round the first line of config:

    4 lines of text from each cell pasted individually:
    set security nat static rule-set CUST-A rule FW-10-10-0-20 description "Test Lab - London1 - 99999998"
    set security nat static rule-set CUST-A rule FW-10-10-0-20 match destination-address 10.10.0.20/32
    set security nat static rule-set CUST-A rule FW-10-10-0-20 then static-nat prefix 192.168.1.20/32
    set security nat static rule-set CUST-A rule FW-10-10-0-20 then static-nat prefix routing-instance INTERNET"

    However when I concatenate the values- either using "&" or CONCATENATE(x,y,z,etc) and puttting a & CHAR(10) CR/newline at the end of each, the result is:

    "set security nat static rule-set CUST-A rule FW-10-10-0-20 description ""Test Lab - London1 - 99999998""
    set security nat static rule-set CUST-A rule FW-10-10-0-20 match destination-address 10.10.0.20/32
    set security nat static rule-set CUST-A rule FW-10-10-0-20 then static-nat prefix 192.168.1.20/32
    set security nat static rule-set CUST-A rule FW-10-10-0-20 then static-nat prefix routing-instance INTERNET"

    You can see the first line has additional " characters in it.

    Any ideas anyone? Probably something to do with the speech marks, but these have to be in as shown in the first example....

    Many thanks...
    R
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Adding CHAR(10) to add line breaks causes speech marks to be added

    Hi and welcome to the forum.

    That's because you've got a final

    &""""

    in E2. Just remove it
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Adding CHAR(10) to add line breaks causes speech marks to be added

    Fozzy279, you mean if you copy cell and paste as command line extra " is present. Unfortunately there is no way to fix it. As I see you need set of commands and for 4 rows of example must be 16 command strings. it could be generated by formulas or VBA but all of them mast be in one column and in separated cell.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. adding line breaks in cell, keeping words on same line
    By beba420 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2017, 07:45 PM
  2. Replies: 8
    Last Post: 03-10-2015, 01:05 AM
  3. Formula to remove speech marks
    By james19 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-07-2014, 11:20 AM
  4. [SOLVED] Unable to get cell count when using line breaks char(10)
    By Ronoh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-01-2014, 01:10 PM
  5. how to remove text contained with speech marks
    By pablowilks in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 03:32 PM
  6. Adding a formula to a cell. Speech marks
    By Typicalalex1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-07-2011, 07:36 AM
  7. [SOLVED] Why does a sumif use double speech marks
    By owl37 in forum Excel General
    Replies: 1
    Last Post: 11-24-2005, 10:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1