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.
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.
I don't know what "causes any how line-breaks" means.
Maybe this will help.
![]()
Please Login or Register to view this content.
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?
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(.ReadText, vbNewLine)
.Close
End With
With Sheet1.Cells(2)
.CurrentRegion.Clear
With .Resize(UBound(SP) - (SP(UBound(SP)) > ""))
.Value = Application.Transpose(SP)
.TextToColumns , xlDelimited, xlNone, True, True, FieldInfo:=[{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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks