473,396 Members | 1,861 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,396 software developers and data experts.

String Manipulation woes

Hi Everybody

I am trying to use string functions to extract data from a field
called Me.txtDataRaw
and put part of it into another field called Me.txtCurrent
Me.txtDataRaw gets data as shown in the 3 examples below

"HSBA.L",
943.795,"10/10/2007","5:29am",-4.2049,949.00,949.00,942.00,8569749
"RBS.L",
551.50,"10/10/2007","5:30am",-6.50,562.00,562.00,549.00,7200732
"DGE.L",
1080.00,"10/10/2007","5:31am",-16.00,1094.00,1100.00,1080.00,2527346

What I would like to retrieve is the part between the 1st and 2nd
commas eg:
943.795
551.50
1080.00
And put it into Me.txtCurrent

It doesn't have to loop through all records just one at a time

Can anyone help me out?
Thanks in advance

Oct 10 '07 #1
3 1834
"bobdydd" <re**************@yahoo.co.ukwrote in message
news:11**********************@19g2000hsx.googlegro ups.com...
Hi Everybody

I am trying to use string functions to extract data from a field
called Me.txtDataRaw
and put part of it into another field called Me.txtCurrent
Me.txtDataRaw gets data as shown in the 3 examples below

"HSBA.L",
943.795,"10/10/2007","5:29am",-4.2049,949.00,949.00,942.00,8569749
"RBS.L",
551.50,"10/10/2007","5:30am",-6.50,562.00,562.00,549.00,7200732
"DGE.L",
1080.00,"10/10/2007","5:31am",-16.00,1094.00,1100.00,1080.00,2527346

What I would like to retrieve is the part between the 1st and 2nd
commas eg:
943.795
551.50
1080.00
And put it into Me.txtCurrent

It doesn't have to loop through all records just one at a time

Can anyone help me out?
Thanks in advance
Dim a As Variant

a = split(Me.txtDataRaw, ",")
Me.txtCurrent = a(1)

Take a look at help for the Split function.

Oct 10 '07 #2
a = split(Me.txtDataRaw, ",")
Me.txtCurrent = a(1)

Take a look at help for the Split function.- Hide quoted text -
Thank you Stuart.....It did exactly what I wanted it to do.
I have been messing about with left and Instr functions to no avail
but your code did it straight off.

I checked out what the VBA help file said about split functions
but there was not much enlightenment to be had there (Access (2007)

When I get some time I will read up on the split function

Once again thanks millions

Oct 10 '07 #3
"bobdydd" <re**************@yahoo.co.ukwrote in message
news:11*********************@o80g2000hse.googlegro ups.com...
I checked out what the VBA help file said about split functions
but there was not much enlightenment to be had there (Access (2007)
It isn't too hard to understand. The Split function takes as its 1st
parameter a delimited string. This can be delimited by just about anything -
in your case it was commas, hence I supplied "," as the 2nd parameter. The
function returns a variant array with one element per item-between-commas,
The elements are numbered starting from zero, which is why I specified a(1).

There's also a Join function which does exactly the opposite of Split (takes
a variant array and joins the elements into a delimited string)

Hope that helps a bit.
Oct 10 '07 #4

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

Similar topics

4
by: Dim | last post by:
I found that C# has some buggy ways to process string across methods. I have a class with on global string var and a method where i add / remove from this string Consider it a buffer... with some...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
29
by: zoro | last post by:
Hi, I am new to C#, coming from Delphi. In Delphi, I am using a 3rd party string handling library that includes some very useful string functions, in particular I'm interested in BEFORE (return...
4
by: WaterWalk | last post by:
Hello, I'm currently learning string manipulation. I'm curious about what is the favored way for string manipulation in C, expecially when strings contain non-ASCII characters. For example, if...
10
by: micklee74 | last post by:
hi if i have a some lines like this a ) "here is first string" b ) "here is string2" c ) "here is string3" When i specify i only want to print the lines that contains "string" ie the first...
5
by: Niyazi | last post by:
Hi, Does anyone knows any good code for string manipulation similar to RegularExpresion? I might get a value as string in a different format. Example: 20/02/2006 or 20,02,2006 or ...
3
by: crprajan | last post by:
String Manipulation: Given a string like “This is a string”, I want to remove all single characters( alphabets and numerals) like (a, b, 1, 2, .. ) . So the output of the string will be “This is...
7
Frinavale
by: Frinavale | last post by:
I currently have a .NET application that has an object which passes a string (a connection string) as a parameter to another object that does database manipulation. This string isn't stored...
22
by: mann_mathann | last post by:
can anyone tell me a solution: i cannot use the features in standard c++ string classgh i included the string.h file but still its not working.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.