Can't you use split function ?
javascript
function SplitDemo(){
var s, ss;
var s = "01:09:2003~20:00~36~~Tour
// Split at each space character.
ss = s.split("~");
return(ss);
}
VBScript also has split
Main Topics
Browse All TopicsHI DOES ANYBODY ONE TO DEVELOP FOR ME A REGEXP TO SEPARATE THESE LINES OUT
HAVE DONE THIS REGEXP VERY SIMPLY BUT JUST GET THE WHOLE AMOUNT OF TEXT AS I MATCH.
objRegExpr.Pattern = "[0-9][0-9]\:[0-9][0-9]\:[
EACH LINE BEGINS WITH A DATE, HAS A FEW IDs AND BITS OF TEXT (WHICH CAN INCLUDE CARRIAGE RETURNS) AND ENDS IN (END) WITH A CARRIAGE RETURN.
once I have the line, then I split it into an array, and insert into DB.
Cheers!!!
==========================
HERE IS THE DATA
01:09:2003~13:00~52~~Serie
01:09:2003~15:00~44~~1999 X Games Classix~~Wrecked~127893~Un
01:09:2003~15:30~44~~2000 X Games Classix~~Discesa BMX~127885~Una puntata sugli X Games del 2000, con i massimi interpreti della BMX.(END)
01:09:2003~16:00~123~~Mond
01:09:2003~16:30~123~~Mond
01:09:2003~17:00~52~~Serie
01:09:2003~19:00~44~~Extre
01:09:2003~19:30~44~~Extre
01:09:2003~20:00~36~~Tour De France, Highlights 2001~~Laurent Jalabert 2001 - 1st Victory~133951~(END)
==========================
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi all,
Splitting it is not the question. That is easy enough!
Plus this is all done in vbscript, so yes I can use the split funtion.
The problem is to be able to get each line as an "individual line" so that it can be split.
I previously did this using a regular expression to parse a whole text string, read from a text file. the are about 500 lines in each file.
Once I had parsed it with regexp then I had a collection of matches. Each match could be split and then inserted into the database.
I guess I could read the file line by line, analyse the line contents and do it that way, but some of the text between the dd:mm:yyyy and (END) has line breaks so is on a new line.
Any further clues? Thanks!
so as i said, the data is read in from a text file into strLinetext and then...
Set objRegExpr = New regexp
objRegExpr.Pattern = "[0-9][0-9]\:[0-9][0-9]\:[
objRegExpr.Global = True
objRegExpr.IgnoreCase = True
'Declare a variable to hold our collection of Matches
Dim colMatches
'Now, Execute the regular expression search
Set colMatches = objRegExpr.Execute(strLine
count = colMatches.Count
Dim objMatch
For Each objMatch in colMatches
str = objMatch.Value
arr = split(str,"~")
then the database happens in this loop!
<SCRIPT language="JavaScript">
<!--
str = "01:09:2003~13:00~52~~Seri
var sents = str.split("(END)")
document.write(sents[0]+"<
//-->
</SCRIPT>
> The problem is to be able to get each line as an "individual line" so that it can be split.
what's the problem?
for each line in split(wholeFileTXT,"(END)"
dataArray = split(line,"~")
response.write "<hr>"
for each data in dataArray
response.write "[" & data & "]<br>" & vbCrLf
next
next
ASPGuru
<SCRIPT language="JavaScript">
<!--
str = "01:09:2003~13:00~52~~Seri
\
01:09:2003~15:00~44~~1999 X Games Classix~~Wrecked~127893~Un
\
01:09:2003~15:30~44~~2000 X Games Classix~~Discesa BMX~127885~Una puntata sugli X Games del 2000, con i massimi interpreti della BMX.(END)\
\
01:09:2003~16:00~123~~Mond
\
01:09:2003~16:30~123~~Mond
\
01:09:2003~17:00~52~~Serie
\
01:09:2003~19:00~44~~Extre
\
01:09:2003~19:30~44~~Extre
\
01:09:2003~20:00~36~~Tour De France, Highlights 2001~~Laurent Jalabert 2001 - 1st Victory~133951~(END)\
"
var sents = str.split("(END)")
document.write(sents[0]+"<
for ( i = 0; i < sents.length; i++ )
{
document.write("line["+(i+
}
//-->
</SCRIPT>
Business Accounts
Answer for Membership
by: rpb1001Posted on 2003-07-30 at 11:04:57ID: 9038428
I had this expression previously and it was working ok.
(END\)\n
Perhaps something in the data has changed somehow.
\d{1,2}:\d{1,2}:(.*)|(\n)\