How to add numbers to a word doc table showing PTR records?

Posted on 2011-04-27
Last Modified: 2012-05-11

I'm looking at a list of PTR records wiithin Word 2007 and I need to add a "1." in front of a list of objects.

For example:
1      PTR
10    PTR
100  PTR

Is there a way to quickly add "1." to the entire list?

So it would like this when completed?
1.1      PTR
1.10    PTR
1.100  PTR

Question by:Admin_Stooge
    LVL 6

    Expert Comment

    The easiest method is to use Find/Replace, e.g. replace any instance of "1" with "1.1" or similar. If your numbers are increasing, it would take a little forethought which numbers to replace first so that you do not add up with "1.1.1" at some point.

    Author Comment

    The numbers range from 1 to 500 and maybe more
    LVL 6

    Expert Comment

    Can you be a bit more specific? If these are IP addresses, the numbers would only go to 255. I was assuming that each number represented an octet in an IP address or subnet mask, so 1.10 would be the end of for example What would a larger finished number look like?

    Author Comment

    When checking the file again, the highest number is 253 and no these numbers are not IPs.  These are Zone Records

    1                       PTR      
    10                      PTR      
    100                     PTR      
    101                     PTR      
    102                     PTR      
    103                     PTR      
    104                     PTR      
    108                     PTR      
    109                     PTR      
    11                      PTR      
    110                     PTR      
    111                     PTR      
    114                     PTR      
    115                     PTR      
    116                     1200      PTR
    117                     PTR      
    118                     PTR      
    119                     PTR      
    12                      PTR      
    120                     PTR      
    127                     PTR      
    128                     PTR      
    13                      PTR      

    So I want to be able to perform a bulk task that will add a "1." to each number
    So afterwards it would look like this:

    1.1                       PTR      
    1.10                      PTR      
    1.100                     PTR      
    1.101                     PTR      
    1.102                     PTR      
    1.103                     PTR      
    1.104                     PTR      
    1.108                     PTR      
    1.109                     PTR      
    1.11                      PTR      
    1.110                     PTR      
    1.111                     PTR      
    1.114                     PTR      
    1.115                     PTR      
    1.116                     1200      PTR
    1.117                     PTR      
    1.118                     PTR      
    1.119                     PTR      
    1.12                      PTR      
    1.120                     PTR      
    1.127                     PTR      
    1.128                     PTR      
    1.13                      PTR      

    LVL 13

    Accepted Solution

    Try using REPLACE  (right side of the Home Ribbon) to replace each Paragraph mark with a Paragraph mark plus the number one and a period

    Find What: ^p
    Replace with: ^p1.

    Replace All

    If you have a paragraph mark at the end of each line, this should work for every line bu the very first.  You can then just update the first line and you should be set
    LVL 6

    Expert Comment

    By IP addresses I meant that they are portions of IP addresses representing DNS zones. I assume, that the new list with the "1." in front represents a new subnet with a "1" in the third octet. At any rate, here is how you can add "1." in front of any number:
    1.      Copy and paste your list into Notepad (not Wordpad) and Save the file.
    2.      Open Excel. File > Open > select the Notepad file > the Text Import Wizard comes up > select Fixed Width > select General > Finish.
    3.      You now have a table divided in three columns, which allows you to sort the list (and incidentally also get rid of the rows more easily, which do not have a number in the first column).
    4.      Highlight the entire first column (the one containing the numbers). In Excel 2003, select Format > Cells > (in Word 2007, select Format > Format Cells... from the Home ribbon) > Number tab > from the Category list, select Custom. In the Type field, type the following string, including the parenthesis:
    Click OK to save
    This will add 1. in front of every number. Blank fields will be ignored. I tested it here and it worked like a charm.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
    The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
    This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
    The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now