Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi - I need to delete the text part of a field eg

"Y2.20.00 room name" to become

"Y2.20.00" Is this possible?

To complicate things the order might change and the number of words vary. eg

"another room name Y3.30"

Sometimes either the name or number is inside brackets

cheers

Edited by Guest

It's probably possible - but we'd need a better formulation of the rules: what to keep and what to discard. It's too easy to jump to the wrong conclusions when all you have is an example or two.

  • Author

Hi Comment

The portion i want to extract is always a letter (or two) followed by numbers and separated by periods

eg

Y2.3.04 or

hd1.4.03.05

x.1.2.4

the discarded part is always text and there is always at least a space separating the parts.

some additional examples

hf2.001 (CP Atrium)

lb2.207 (LT14)

LT 1 (I2.02)

Edited by Guest

OMG, what a nightmare. Hm... try:


Let ( [

mask = Substitute ( text ; [ "0" ; "#" ] ; [ "1" ; "#" ] ; [ "2" ; "#" ] ; [ "3" ; "#" ] ; [ "4" ; "#" ] ; [ "5" ; "#" ] ; [ "6" ; "#" ] ; [ "7" ; "#" ] ; [ "8" ; "#" ] ; [ "9" ; "#" ] ) ;

mark = Position ( mask ; "#." ; 1 ; 1 ) ; 

start = Position ( " " & text ; " " ; mark ; - 1 ) ; 

cut = Right ( text ; Length ( text ) - start + 1 )

] ;

LeftWords ( cut ; 1 )

)

  • Author

Indeed is a nightmare

Unfortunately still some errant fields

UA (EAST DINING ROOM - jb1.103)

LT13 (jb1.103)

J.1.23

Maybe not possible?

UA (EAST DINING ROOM - jb1.103)

LT13 (jb1.103)

What is your expected result here? And what do you get?

J.1.23

Oh, I see - the period can come between letters and digits, too. OK, so how about:


Let ( [

mask = " " & Substitute ( text ; [ "0" ; "#" ] ; [ "1" ; "#" ] ; [ "2" ; "#" ] ; [ "3" ; "#" ] ; [ "4" ; "#" ] ; [ "5" ; "#" ] ; [ "6" ; "#" ] ; [ "7" ; "#" ] ; [ "8" ; "#" ] ; [ "9" ; "#" ] ) & " " ;

mark = Position ( mask ; "#." ; 1 ; 1 ) ; 

start = Position ( mask ; " " ; mark ; - 1 ) ; 

end = Position ( mask ; " " ; mark ; 1 ) 

] ;

Substitute ( Middle ( text ; start ; end - start ) ; [ "(" ; "" ] ; [ ")" ; "" ] )

)

  • Author

This seems to work

let([

mark = Position (text ; "." ; 1 ; 1 ) ;

mark2 =Position (text ; " " ; 1 ; 1 )] ;

Case(mark

except for J.1.23 (which reads as 2 words). I guess I can to a test on the result - case length(text)=1 then i use leftwords(text,2)

mark = Position (text ; "." ; 1 ; 1 ) ;

Are you saying there won't be periods anywhere else in the text?

I guess I can to a test on the result - case length(text)=1 then i use leftwords(text,2)

I don't think that will work for something like "AB.123".

  • Author

Thanks for your time Comment,

Are you saying there won't be periods anywhere else in the text?

I don't think that will work for something like "AB.123".

Yes the section to be removed contains text only (sorry if not clear in the OP)

my final solution

code

LW=LeftWords(text;1);

RW=RightWords(text;1);

mark = Position ( text ; "." ; 1 ; 1 ) ; 

mark2 =Position (text ; " " ; 1 ; 1 ) ; 

text=Case(mark

LW=LeftWords(text;1);

RW=RightWords(text;1)

];

Case(mark

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.