Splitting on vbCRLF 
Author Message
 Splitting on vbCRLF

Hi,

i'm reading a CSV file and would to to split its content by rows and
columns. Thus I do something like:
- sourceContent = {read content of my file}
- sourceRows = sourceContent.Split(vbCrLf)
- sourceColumns=sourceRows(0).Split(";")

Unfortunately, the first item of souceColumns begins with chr$(10) (split
has been done only on chr$(13). I tryed to clean up these items by using
item=sourceColumns(0).Replace(10,"") but doesn't work at all.

Any idea would be greatly appreciated!

Thanks,
Serge



Thu, 01 Dec 2005 15:51:22 GMT  
 Splitting on vbCRLF
How about:

<Untested>
sourceContent = {read content of your file}
sourceContent = sourceContent.Replace(Chr(10), "")
sourceRows = sourceContent.Split(vbCr)
sourceColumns = sourceRows(0).Split(";")
</Untested>

--
Happy to help,
-- Tom Spink

Please respond to the newsgroup,
so all can benefit.

One Day,

Quote:
> Hi,

> i'm reading a CSV file and would to to split its content by rows and
> columns. Thus I do something like:
> - sourceContent = {read content of my file}
> - sourceRows = sourceContent.Split(vbCrLf)
> - sourceColumns=sourceRows(0).Split(";")

> Unfortunately, the first item of souceColumns begins with chr$(10) (split
> has been done only on chr$(13). I tryed to clean up these items by using
> item=sourceColumns(0).Replace(10,"") but doesn't work at all.

> Any idea would be greatly appreciated!

> Thanks,
> Serge



Thu, 01 Dec 2005 16:15:16 GMT  
 Splitting on vbCRLF
Thanks a lot Tom, it works!!!

Serge

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Thu, 01 Dec 2005 16:56:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. vbcrlf or vbCrLf

2. Best way to split string - mid() or split()?

3. get the total split words value by using the command split

4. Split Bars & Split Windows

5. how to split a split string

6. Splitting arrays. X=split(split(y,"~"),"*") How Do i do this

7. vbCrLf after attachment - (not '.Body')

8. vbCrLf - what is it?

9. vbcrlf

10. Embedded vbLF in message body is converted to vbCRLf

11. Squares using vbCrLf or Chr(13)

12. Stripping vbCrLf from strings

 

 
Powered by phpBB® Forum Software