March 28, 2024, 02:30:57 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Extracting text

Started by Brian, June 11, 2022, 05:40:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

June 11, 2022, 05:40:22 AM Last Edit: June 11, 2022, 09:58:13 AM by Brian
Hello,

I need to extract certain text from a line to a variable. The line would resemble "Fred Bloggs 20/20/2022"

All I need is the name part of the text. Obviously, names could be shorter or longer than the example

Any ideas?

Brian

PS: Figured out a way to do it, thanks

LarryMc

If it had been me, I would have waited a bit to see if anyone responded with a solution before posting that you had found one.

1. It might have prompted a little activity on the forum.

2. You might have wound up with a better solution...possibly.

Just saying...
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

I did think about that, Larry, but I was "in the moment" and just wanted to get it done

Brian

billhsln

Will your format be the standard, as in will there only be First Last Date.  Or will there be things like John Doe, Jr  or Dr John Smith?

Bill
When all else fails, get a bigger hammer.

Brian

Bill,

The name part could be any length, with spaces, but the date part is standard 12/34/5678

Brian

billhsln

in = "Bob Johnston 12/31/2022"
full_name = MID$(in,1,LEN(in)-11)

Short and sweet.

Bill
When all else fails, get a bigger hammer.