+ Reply to Thread
Results 1 to 4 of 4

Unicode character creates a line break

  1. #1
    Registered User
    Join Date
    12-07-2008
    Location
    Helsinki Finland
    Posts
    11

    Unicode character creates a line break

    Hi,

    I'm using line input statement to replace specific unicode characters. The attached file with ChrW(269) causes any how line-breaks eventhough I've tried the replace statement. What to do?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Unicode character creates a line break

    I don't know what "causes any how line-breaks" means.

    Maybe this will help.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-07-2008
    Location
    Helsinki Finland
    Posts
    11

    Re: Unicode character creates a line break

    If you open the attached csv file in excel the 'c with the hat' creates a line break, even though it should not. Therefore I tried to replace the character to a normal c, so that this would not happen. The Line Input statement however has already decided that it is a line break, so the replace function does not find the character anymore.

    This means that I should somehow be able to replace the character before the line input statement?

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi !


    Try this demonstration in a new workbook, just amend the CSV constant :

    PHP Code: 
    Sub DemoReadUnicode()
        Const 
    CSV "D:\Tests4Noobs\test.csv"
        
    Dim SP$()
        If 
    Dir(CSV) = "" Then Beep: Exit Sub

        With CreateObject
    ("ADODB.Stream")
            .
    Open
            
    .LoadFromFile CSV
            SP 
    Split(.ReadTextvbNewLine)
            .
    Close
        End With

        With Sheet1
    .Cells(2)
            .
    CurrentRegion.Clear

            With 
    .Resize(UBound(SP) - (SP(UBound(SP)) > ""))
                 .
    Value Application.Transpose(SP)
                 .
    TextToColumns xlDelimitedxlNoneTrueTrueFieldInfo:=[{1,2}]
            
    End With
        End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

    _______________________________________________________________
    Je suis Charlie

+ 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. Replies: 7
    Last Post: 12-18-2016, 03:04 PM
  2. Replies: 12
    Last Post: 06-22-2016, 01:11 PM
  3. Concatenate with a Unicode Character
    By Landon Y in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-25-2014, 03:59 PM
  4. [SOLVED] Break a line of text at specfied character count
    By kazphilips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-14-2013, 12:45 AM
  5. Macro Add line break after character
    By Tybalt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-01-2013, 09:08 PM

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