IonicWind Software

IWBasic => General Questions => Topic started by: Brian on June 11, 2022, 05:40:22 AM

Title: Extracting text
Post by: Brian on June 11, 2022, 05:40:22 AM
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
Title: Re: Extracting text
Post by: LarryMc on June 11, 2022, 09:43:51 PM
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...
Title: Re: Extracting text
Post by: Brian on June 12, 2022, 05:33:46 AM
I did think about that, Larry, but I was "in the moment" and just wanted to get it done

Brian
Title: Re: Extracting text
Post by: billhsln on June 13, 2022, 01:09:56 PM
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
Title: Re: Extracting text
Post by: Brian on June 14, 2022, 03:17:55 AM
Bill,

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

Brian
Title: Re: Extracting text
Post by: billhsln on June 14, 2022, 10:53:35 AM
in = "Bob Johnston 12/31/2022"
full_name = MID$(in,1,LEN(in)-11)

Short and sweet.

Bill