I need to add a single quote at the begining and end to a 5 position integer field in TextPad.
Ex:
14982
14983
14985
14991
14995
15019
Desired result:
'14982',
'14983',
'14985',
'14991',
'14995',
'15019'
Press F1, the Textpad help provides a very useful hint with examples:
^.*?$'$0',Wala!
Just use the search-and-replace function:
\(\d\d\d\d\d\) as the source (you can also use \(\d{5}\) )—space at the end'\1', as the target (again a space at the end), at the end of the line(s):
, $ as the source
Replace \(\<[0-9]\{5\}\>\) (words consisting of exactly five digits) with '\1', and then ' ' with ', '.
Two steps: 1.For the first "'" (single quote), put ^ on Find What text box and ' on the Replace with text box. 2. for the second "'" (single quote) and ", " , put $ on Find What text box and ' , on the Replace with text box. 'D4881', 'D2243', 'G7051', 'X9767', 'D3040',
Enter ^ in the 'Find what' and ' in the 'Replace with' and Regular expression selected
Enter $ in the 'Find what' and ', in the 'Replace with' and Regular expression selected
Easier solution
(\d{5})'\1', <checked>