Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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'
share|improve this question

4 Answers 4

Just use the search-and-replace function:

  1. Check the regex box
  2. Use \(\d\d\d\d\d\)  as the source (you can also use \(\d{5}\) )—space at the end
  3. Use '\1',  as the target (again a space at the end)
  4. Replace all
  5. Delete the extraneous at the end of the line(s):
    • Manually if there’s a few
    • Using regular expressions if there’s a lot:
      1. Check the regex box
      2. Use , $ as the source
      3. Use an empty field for the replacement text
      4. Replace all

enter image description here

share|improve this answer

Replace \(\<[0-9]\{5\}\>\) (words consisting of exactly five digits) with '\1', and then ' ' with ', '.

share|improve this answer

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',

share|improve this answer

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

share|improve this answer
1  
Please explain how this answer is better than the answer posted by Sarah Cao? –  DavidPostill Oct 9 at 19:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.