Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Select to right of &

Posted on 2006-11-14
4
Medium Priority
?
634 Views
Last Modified: 2008-03-04
HI folks.

I've got a field in my db that as too many values in it, and I need to split it up.  The character inserted that indicates the split is "&".

For example...

530903356&05/2007&999&&Felix+Nemitz

The first set of numbers is no set length.
The second set should always be the same
The third set is 3 characters
The final set is a name.

I want to split them like this

Num = 1st set
date = 2nd set
secret = 3rd set
Name = Last set

How can I do this with VBscript???

Thanks
0
Comment
Question by:ClassyLinks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 31

Accepted Solution

by:
alorentz earned 2000 total points
ID: 17939308
Then split it with split function.

<%
val = "530903356&05/2007&999&&Felix+Nemitz"
arr = split(val, "&")
for i = 0 to ubound(arr)
  response.write arr(i) & "<br>"
next
%>
0
 
LVL 31

Expert Comment

by:alorentz
ID: 17939313
0
 
LVL 2

Expert Comment

by:_DanElliott
ID: 17939327
You can use the Split function to get the values into an array:

Dim values
values = Split(String_to_Split,"&")

Now values is an array and:
values(0) = the first part (num)
values(1) = the second part (date)
values(2) = the third part (secret)
values(3) = the fourth part (name)

0
 
LVL 31

Expert Comment

by:alorentz
ID: 17939389
>>DanElliott

When reposting, whether by mistake or not, it's good to acknowledge you provided the same answer as already suggested.  thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question