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.

Creating Order from Chaos

Featured Replies

I've got about 97,000 records with each record being a unique file name. The file names are everything from "Picture 1.png" to things like "724358428520_108594.TIF".

What I need is a script that will look for a block of numbers in each file name, then copy that block of numbers to another field in that record. The blocks of numbers can be anywhere from six to 20 digits. They are not in the same place in every file name. They are always separated from the other components of the file name by a space, dash, or underscore. Some file names have numbers attached to letters in addition to the block of numbers I need (e.g., "coltrane-72dpi-727738.jpg"). Some file names have multiple blocks, e.g., "Roof_028_20100126_150547.jpg" or "724353767020_104967_RGB_3x3_72.JPG" in which case I would need an "all-encompassing" set of numbers ("028_20100126_150547" and "724353767020_104967" in this example, respectively).

Is there ANY hope of salvaging these numbers through some clever scripting?

Is there ANY hope of salvaging these numbers through some clever scripting?

Sure. First, substitute dashes with spaces (or underscores) so that each "block" becomes a separate word. Then use a looping script or a custom function to check each word for:

word = Filter ( word ; "0123456789" ) and Length ( word ) ≥ 6

I would need an "all-encompassing" set of numbers ("028_20100126_150547" and "724353767020_104967"

Not sure how useful such format would be.

Edited by comment

This calculation may not cover all the possibilities ... but you can try it.

Let([

x = YourField ;

code = Substitute ( Trim ( Substitute ( Filter ( x ; 1234567890 & "_ -" ) ; [ " " ; "§§§" ] ; [ "_" ; " " ] ) ) ; [ "-" ; ¶ ] ; [ "§§§" ; ¶ ] ; [ " " ; "_" ] ; [ "__" ; ¶ ] )

];

Case(

Length ( GetValue ( code ; 1 ) ) ≥ 6 ; GetValue ( code ; 1 ) ;

Length ( GetValue ( code ; 2 ) ) ≥ 6 ; GetValue ( code ; 2 ) ;

Length ( GetValue ( code ; 3 ) ) ≥ 6 ; GetValue ( code ; 3 )

)

)

your examples |--------------------| result

Picture 1.png

724358428520_108594.TIF |----------| 724358428520_108594

coltrane-72dpi-727738.jpg |--------| 727738

Roof_028_20100126_150547.jpg |-----| 028_20100126_150547

724353767020_104967_RGB_3x3_72.JPG | 724353767020_104967

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.