473,378 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Split function not working.....

Jay
So I'm writting this software that talks to an IRC server; and occasionaly
IRC servers send back data two lines at a time with lines breaks inside.
For my own sanity I had been using the split funciton to break these lines
down to seperate ones and then process the server commands etc. However
lately the split funciton seems incapable of finding chr(10)+chr(13) and
wont split the lines. When I dump the data to a text file however and open
it in notepad, notepad recognizes the lines and seperates them.

What is going on and how can I fix it?
Nov 20 '05 #1
2 1844
Jay wrote:
So I'm writting this software that talks to an IRC server; and
occasionaly IRC servers send back data two lines at a time with lines
breaks inside. For my own sanity I had been using the split funciton
to break these lines down to seperate ones and then process the
server commands etc. However lately the split funciton seems
incapable of finding chr(10)+chr(13) and wont split the lines. When
I dump the data to a text file however and open it in notepad,
notepad recognizes the lines and seperates them.


A newline in Windows is chr(13) & chr(10) not the other way around.

Use the ControlChars.CrLf or ControlChars.NewLine constants.

--
Sven Groot

http://unforgiven.bloghorn.com
Nov 20 '05 #2
Jay
Oh Thank You, I thought I was going to loose my mind today :-)
"Sven Groot" <sv*******@gmx.net> wrote in message
news:#o**************@TK2MSFTNGP09.phx.gbl...
| Jay wrote:
| > So I'm writting this software that talks to an IRC server; and
| > occasionaly IRC servers send back data two lines at a time with lines
| > breaks inside. For my own sanity I had been using the split funciton
| > to break these lines down to seperate ones and then process the
| > server commands etc. However lately the split funciton seems
| > incapable of finding chr(10)+chr(13) and wont split the lines. When
| > I dump the data to a text file however and open it in notepad,
| > notepad recognizes the lines and seperates them.
|
| A newline in Windows is chr(13) & chr(10) not the other way around.
|
| Use the ControlChars.CrLf or ControlChars.NewLine constants.
|
| --
| Sven Groot
|
| http://unforgiven.bloghorn.com
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Arjen | last post by:
Hi All, What I want to is using a string as PATTERN in a split function. This makes it possible for me to change the PATTERN on one place in my script... For example: $separator = ";"; $line...
2
by: SL_McManus | last post by:
Hi All; I am fairly new to Perl. I have a file with close to 3000 lines that I would like to split out in a certain way. I would like to put the record type starting in column 1 for 2 spaces,...
5
by: NewToThis | last post by:
I am trying to use the split function to bread up lines in a file I am reading from. Some lines are working just fine, but a couple of the lines don't split up the way I would have thought. ...
0
by: j | last post by:
Hi, Anyone out there with binary search tree experience. Working on a project due tomorrow and really stuck. We need a function that splits a binary tree into a bigger one and smaller one(for a...
4
by: Brian Glen Palicia | last post by:
My goal is to accept input from the user into a text box and then parse the data using split(). The first step is this tiny program to test the split() function. It runs in IE, but in Mozilla it...
2
by: Jay | last post by:
Well this is my function to split the data into its own lines Sub preSift(ByVal input As String) Dim spl() As String spl = New String() {} spl = Split(input, ControlChars.NewLine) ', ,...
8
by: ronrsr | last post by:
I'm trying to break up the result tuple into keyword phrases. The keyword phrases are separated by a ; -- the split function is not working the way I believe it should be. Can anyone see what I"m...
1
Atli
by: Atli | last post by:
The following small HowTo is a compilation of an original problem in getting some cookie-values through different methods of string-handling. The original Problem was posted as follows: As...
1
by: mad.scientist.jr | last post by:
I am working in C# ASP.NET framework 1.1 and for some reason Regex.Split isn't working as expected. When trying to split a string, Split is returning an array with the entire string in element ...
14
by: Stevo | last post by:
If you split a string into an array using the split method, it's not working the way I'd expect it to. That doesn't mean it's wrong of course, but would anyone else agree it's working somewhat...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.