Macro for Handy sms list

Macro for Handy sms list

5
NewbieNewbie
5

    Jun 02, 2005#1

    hi,

    my nokia can export the sms on the pc file system but in propretary file.
    and every sms in one file....

    so how could i create a macro that copies specific content of the file into one collection.
    so everything is ready for a "one view" file?
    i never created a macro... don't blame me ;)

    File example:
    BEGIN:VMSG
    VERSION:1.1
    X-IRMC-STATUS:READ
    X-IRMC-BOX:INBOX
    BEGIN:VCARD
    VERSION:2.1
    N:
    TEL:+491111111111
    END:VCARD
    BEGIN:VENV
    BEGIN:VCARD
    VERSION:2.1
    N:
    TEL:+491111111111
    END:VCARD
    BEGIN:VENV
    BEGIN:VBODY
    Date:26.04.2005 10:40:28
    nachricht Empfangen
    END:VBODY
    END:VENV
    END:VENV
    END:VMSG
    and i like to "parse" out the X-IRMC-STATUS:, Tel: , Tel: , Date: and the Content (line after the Date line)

    hope someone can help this little newbee

    THANKS!

      Jun 03, 2005#2

      Bisher hab ich das:
      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      SelectAll
      Copy
      EndSelect
      Top
      NewFile
      Paste
      Bottom
      IfColNum 1
      Else
      "
      "
      EndIf
      Top
      TrimTrailingSpaces
      Find RegExp "+49"
      Replace All "00"
      Find RegExp "BEGIN:VMSG"
      Replace All ""
      Find RegExp "VERSION:1.1"
      Replace All ""
      Find RegExp "X-IRMC-STATUS:"
      Replace All ""
      Find RegExp "X-IRMC-BOX:INBOX"
      Replace All ""
      Find RegExp "BEGIN:VCARD"
      Replace All ""
      Find RegExp "VERSION:2.1"
      Replace All ""
      Find RegExp "TEL:"
      Replace All ""
      Find RegExp "BEGIN:VENV"
      Replace All ""
      Find RegExp "END:VCARD"
      Replace All ""
      Find RegExp "BEGIN:VBODY"
      Replace All ""
      Find RegExp "Date:"
      Replace All ""
      Find RegExp "END:VBODY"
      Replace All ""
      Find RegExp "END:VENV"
      Replace All ""
      Find RegExp "END:VMSG"
      Replace All ""


      jedoch geht das nur wenn an beiden stellen telefonnummern stehen und ein "+" drin steht.
      Dies ist aber nicht immer der fall.

      Müsste also das "+" vorher durch 00 ersetzen.
      kann aber nicht nach "+" suchen :(

      die unterscheidung wo die nummer steht kann ich am Keyword machen (READ/SENT)

        Jun 03, 2005#3

        Oh switch back to english.
        now i have 2 problems.

        first i have to replace the "+" to "00"

        if the search for "READ" fails, it never runs the else case... a windwow appears.

        Find "READ"
        IfFound
        .....
        else
        ...
        endif

        6,688587
        Grand MasterGrand Master
        6,688587

          Jun 03, 2005#4

          First, Continue if a Find with Replace not found in the macro properties must be activated.

          Second, the + sign has a special meaning for regular expression searches in UltraEdit style. Use ^+ instead of +. But I can't see, why you need regular expressions for these simple replacements. Better remove RegExp at every find command.

          German: Hoffe dir hilft das.
          Best regards from an UC/UE/UES for Windows user from Austria

          5
          NewbieNewbie
          5

            Jun 03, 2005#5

            The "continue" worked!

            but

            Find "^+"
            Replace All "00"

            doesn't lead me to a replacement status at all :(

            i also tried

            Find ^+
            Replace All "00"

            any hint?

            i also replaced the Expressions. Thanks!!!

              Jun 03, 2005#6

              next step will be to let the marco run on every opend file (i shave seen somethin in tis forum and try it) and then copy each row from the single files into one big file.
              if someone can make my live easier... always open for hints.
              otherwise i will investigate by my own.

              6,688587
              Grand MasterGrand Master
              6,688587

                Jun 04, 2005#7

                The ^ is only needed within a regular expression, when character + should be found. + in a regular expression in UltraEdit style normally means: the character before + 1 or more times.

                Examples to demonstrate:

                Find RegExp "1^+" finds only the string "1+".
                Find RegExp "1+" finds the strings "1", "11", "111", ...

                So after removing the RegExp, because you don't need really it, you now can simply write + without the control character ^.

                Here is your macro, which runs on all open files and copies the result to a new file. The inserted code for the loop is green . I have not tested the macro!

                InsertMode
                ColumnModeOff
                HexOff
                UnixReOff
                Clipboard 9
                ClearClipboard
                Loop
                IfNameIs ""
                ExitLoop
                EndIf

                Bottom
                IfColNum 1
                Else
                "
                "
                EndIf
                Top
                TrimTrailingSpaces
                Find "+49"
                Replace All "00"
                Find "BEGIN:VMSG"
                Replace All ""
                Find "VERSION:1.1"
                Replace All ""
                Find "X-IRMC-STATUS:"
                Replace All ""
                Find "X-IRMC-BOX:INBOX"
                Replace All ""
                Find "BEGIN:VCARD"
                Replace All ""
                Find "VERSION:2.1"
                Replace All ""
                Find "TEL:"
                Replace All ""
                Find "BEGIN:VENV"
                Replace All ""
                Find "END:VCARD"
                Replace All ""
                Find "BEGIN:VBODY"
                Replace All ""
                Find "Date:"
                Replace All ""
                Find "END:VBODY"
                Replace All ""
                Find "END:VENV"
                Replace All ""
                Find "END:VMSG"
                Replace All ""
                SelectAll
                CopyAppend
                CloseFile NoSave
                EndLoop
                NewFile
                Paste
                Top
                ClearClipboard
                Clipboard 0
                Best regards from an UC/UE/UES for Windows user from Austria

                Stephen_Hatton
                Stephen_Hatton

                  Jun 15, 2005#8

                  Hi All

                  I had phun finding some things in RegExp. I found [] was the only way to hunt down the difficult ones.

                  (as described in UE search help).
                  to find . use [.]
                  to find , use [,]
                  to find ? use [?]

                  eg. to find + use [+]

                  If you really have problems, then switch to hex and replace the character that way and switch back to ascii.

                  I needed it for getting filenames (with single dot separator) out of HTML links:
                  eg: ht2p:\\www.mysite.com/This-Is_A-Complicated.html

                  so my search was:
                  Find RegExp "/^([-0-9a-z_]+[.]html^)"
                  Replace All "/^p^t^1^p"

                  Tutorial: How it works for beginners:
                  Find the following search string and store it temporarily as variable "1"
                  ****************************************************
                  Find RegExp "/^([-0-9a-z_]+[.]html^)"
                  ****************************************************
                  / = web directory path delimiter for link
                  ^( = The start of selecting the search expression as variable "1"
                  [-0-9a-z_] = find any characters "hyphen or 0 to 9 or a to z or underscore" (the position of the hyphen is important - doesn't work in any position)
                  + = Find one or many of the previous characters (the type decrbed in the square boxes)
                  [.] = Find the dot separator
                  html = is the last four characters of our search
                  ^) = the end of selecting variable "1"

                  Then replace what it found above with
                  ****************************************************
                  Replace All "/^p^t^1^p"
                  ****************************************************
                  / = replace the slash back
                  ^p = follow it with a paragraph marker
                  ^t = then with a tab character
                  ^1 = then put the variable "1" back (this is the filename)
                  ^p = follow it with a paragraph marker

                  eg: ht2p:\\www.mysite.com/This-Is_A-Complicated.html

                  becomes:
                  ht2p:\\www.mysite.com/{paragraph character}
                  {tab character}This-Is_A-Complicated.html{paragraph character}


                  (and Yep, I mispelt ht2p:\\www - I had to, otherwise it showed up as a link and you couldn't see the underscore)


                  Regards
                  Ing. Stephen Hatton
                  :idea: