Tapatalk

for each row?

for each row?

161
Basic UserBasic User
161

    Aug 26, 2005#1

    I've been using UE for a few years now, I love it, but I haven't taken it to the next step, or even used its fullest potential.

    I have a file that needs to be changed, and so I figured I could create a macro for this.

    Here is the logic:

    -------------------------
    Find ,
    Replace with ";"

    Goto line 1
    Find " in line 1
    Replace with nothing

    Foreachrow add " to beginning and " to end of row
    -------------------------

    I am not sure how to do the "for each row" part... any suggestions on the macro code?

    6,685587
    Grand MasterGrand Master
    6,685587

      Aug 26, 2005#2

      This macro should to the job.

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      Top
      Find ","
      Replace All ";"
      SelectLine
      Find """
      Replace All SelectText ""
      EndSelect
      Top
      Find RegExp "%^([~^p]+^)"
      Replace All ""^1""
      UnixReOn

      Remove the last red command, if you use regular expression in UltraEdit style by default instead of Unix style - see Advanced - Configuration - Find - Unix style Regular Expressions. UnixReOn/UnixReOff modifies this setting.
      Best regards from an UC/UE/UES for Windows user from Austria

      161
      Basic UserBasic User
      161

        Aug 26, 2005#3

        Mofi, that works great!

        I moved this:
        SelectLine
        Find """
        Replace All SelectText ""
        EndSelect

        Below the RegExp so that the first line would not contain a beginning/ending "

        One more question... :)
        At the end of my file, I have a bunch of the following:

        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
        "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""

        Any way to delete this? It isn't caused from a logic error in the macro, it is the file format that I am using.

        6,685587
        Grand MasterGrand Master
        6,685587

          Aug 27, 2005#4

          Ah, you want to delete all empty lines of your csv-file. No problem! Add this to your macro

          Find RegExp "%[";]+^p"
          Replace All ""

          This regular expression in UltraEdit style will find all lines which contain only " and ; and will delete these lines. Hope, you do not have such lines anywhere else in your file.
          Best regards from an UC/UE/UES for Windows user from Austria

          161
          Basic UserBasic User
          161

            Aug 27, 2005#5

            Mofi,

            I appreciate the time you have taken to help out with these very hard questions (for me).

            I would not have been able to figure this one out on my own ;)