Replace first comma of each line with a tab??

Replace first comma of each line with a tab??

2
NewbieNewbie
2

    Apr 21, 2006#1

    I'm new to this and trying to figure out a way to replace only the first comma of each line with a tab.

    Last name, first name (tab)company name, Inc. (tab)position (optional)

    I only want to delete the first comma because of the company name which may contain a second comma, as well as the position which sometimes contains a third comma. Also, the lastname may be two words separated by a space, or a hyphen.

    Any ideas?


    Thanks,

    JP

    6,678585
    Grand MasterGrand Master
    6,678585

      Apr 22, 2006#2

      Use this UltraEdit style regular expression. The help of UE about the Find command and regular expression should help you to understand it.

      Find: %^([~,^r^n]+^),
      Replace: ^1^t

      % means start search at every begin of a line.

      ^(...^) a string found with the expression inside the brackets can be used again in the replace with ^1 (and ^2, ^3, ... up to 9 expressions are possible).

      [~,^r^n] means NOT a ',' or line termination character (carriage return or linefeed).

      + means preceding expression or character one or more times.

      So the whole search expression means:
      Find a string at begin of a line which has at least 1 character and does not contain a comma or a line termination character. This string is marked for usage in the replace string too. After this string a comma must follow. The whole found string is replaced with the marked part - so the string from begin of the line to first comma does not change - and a tab character which replaces the comma.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        May 05, 2006#3

        Wow, Mofi... Thanks so much for your help!

        Sorry it took me so long to get back here to reply... My hard drive and back up died simultaneously. My list cleaning problem quickly became the least of my worries (Ugh).