1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mass editing text files

Discussion in 'White Hat SEO' started by Pixel Pirate, Mar 1, 2011.

  1. Pixel Pirate

    Pixel Pirate Junior Member

    Joined:
    Jun 24, 2010
    Messages:
    124
    Likes Received:
    100
    I'm working on a clients site and he has a list of hundreds of cities each on its own line in the text file. Is there any editing software or script to put all the cities on one line separated with a comma?

    From

    city1
    city2
    city3

    To

    city1, city2, city3
     
  2. srb888

    srb888 Elite Member

    Joined:
    Jul 30, 2008
    Messages:
    3,260
    Likes Received:
    5,067
    Gender:
    Male
    Occupation:
    WebzSurfer
    Location:
    Sun, Mon, Tue, WTF, Sat!!! :)
    Use TextPad


    1. Select the list (the list will become highlighted)
    2. Then use "Replace..." command (Usually F8 or see Search menu)
    3. In "Find What:", type "\n" (without quote marks)
    4. In "Replace With:" type ", " (comma and space (without quote marks))
    5. Keep "Regular Expression" box ticked
    6. Press "Replace All" button

    There you are!
     
    • Thanks Thanks x 2
    Last edited: Mar 1, 2011
  3. Pixel Pirate

    Pixel Pirate Junior Member

    Joined:
    Jun 24, 2010
    Messages:
    124
    Likes Received:
    100
    Worked like a charm. Thanks!
     
    • Thanks Thanks x 1