Forum Discussion

michaeltrombetta's avatar
michaeltrombetta
Copper Contributor
Jun 22, 2024

Deleting unwanted parts of a line

I have an address list, name, address, phone number. I want to keep just the name. The non-name part of the line begins with a digit. I wish I could find that first digit, and delete the rest of the line. 

I appreciate any help.

    • michaeltrombetta's avatar
      michaeltrombetta
      Copper Contributor
      The file is an address list. A typical line looks like this:
      Smith, John & Mary, 457 Park Avenue, New York, 212-345-6789
      I want to extract just the first and last name part, so I'd like to find the first digit, and delete everything beyond that.
      The file is only about 60 lines, so I could do it manually, but I proposed it as a interesting question.
      Thank you for your help.
      • Doug_Robbins_Word_MVP's avatar
        Doug_Robbins_Word_MVP
        MVP

        michaeltrombetta 

        Select all of the text and then from the Insert>Table dropdown, click on Convert Text to Table

        and, then, in nthe Convert Text to Table dialog, select Commas in the Separate text at section and click on OK

        Then, delete the unwanted columns from the resulting table

         

         

Resources