I have a field called part number with 12000 records and the first two digits need to be removed. Is there a script to do that?
you can use a replace on the entire found set of your 12000 records.
the replace would use a calculation like:
Middle ( YourTable::YourField ; 3 ; Length ( YourTable::YourField )
The Replace Field Contents suggestion is sound. However, one world of warning. The use of this feature is a "no turning back" feature. In other words, there is no UNDO if it does something bad. I only mention this on the chance that the provided suggestion(s) do not really do what you want it to do.
If possible, you might try this, and other, suggestions, on a test field or file so that you get a sense of what it is really going to do before you apply it to your "production field." Just a suggestion.
Replace ( table::field ; 1 ; 2 "" ) will do a single field.
may i suggest:
Replace ( table::field ; 1 ; 2 ; "" )
FileKraft wrote: you can use a replace on the entire found set of your 12000 records. the replace would use a calculation like: Middle ( YourTable::YourField ; 3 ; Length ( YourTable::YourField )
needs one more closing ")"
Middle ( YourTable::YourField ; 3 ; Length ( YourTable::YourField ))
This assumes your part number field is type Text
Go to Record/Request/Page [ First ]
Set Field [ Part number ; Right ( Part number;( Length ( Part number ) - 2 ) ) ]
Go to Record/Request/Page [ Next; Exit after last ]
If your part number field is type Number then you need to do this
Go to Record/Request/Page[ First ]
Set Field [ Part number num ; Let ( $PN = GetAsText ( Part number num ) ; GetAsNumber ( Right ( $PN;( Length ( $PN ) - 2 ) )) ) ]
One more thing pick you field name from the list as table info the field is in is also needed.
Also you need to make sure nobody else is using the file when you do it. or you will needed some way to keep track of locked records that don't get updated. or keep looping on the record until it lets you update it.
Retrieving data ...