Is it possible to manipulate date?

Is it possible to manipulate date?

2
NewbieNewbie
2

    Jan 04, 2005#1

    I am formatting raw data and I need to add a date (yesterday) to each line. Is this possible?

    Thanks
    Hopper

    6,684586
    Grand MasterGrand Master
    6,684586

      Jan 06, 2005#2

      In principle - yes. Give us more details about what you really want and how it should work.

      Do you need only once a specific date at each line or do you need a macro which adds the date of yesterday every day to each line of a file?

      The second one would be very hard to decode with UltraEdit's macro language. So a compiled program would be better for this.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Jan 06, 2005#3

        Hi Mofi!

        Thanks for the reply!

        Here is what I have. I got an exported text file for every day.

        Code: Select all

        uni_010105.txt
        uni_010205.txt
        uni_010305.txt
        uni_010405.txt
        uni_010505.txt
        etc.
        There is no date in the text file.

        I currently run a macro that formats the text and publishes it to the web. Originally, I was just inserting yesterday into the file, but now that there are multiple files, I need to identify the data set by date. And merge the files all into one file.

        I have a macro that formats an exported text file into:

        Code: Select all

        .88,$0.00,,,,WEST,REG,17131,010517, 
        9.13,$0.00,,,2003,WEST,REG,00000,210056, 
        3.15,$0.00,1,,2006,WEST,OT,17131,010517,
        8.00,$0.00,1,,2006,WEST,REG,17131,010517,
        1.25,$0.00,1,,2006,,OT,17131,010517,
        My goal is to end up with a recap file that contains all files and dates.

        Code: Select all

        .88,$0.00,,,,WEST,REG,17131,010517,01/01/05,
        9.13,$0.00,,,2003,WEST,REG,00000,210056,01/01/05,
        3.15,$0.00,1,,2006,WEST,OT,17131,010517,01/02/05,
        8.00,$0.00,1,,2006,WEST,REG,17131,010517,01/03/05,
        1.25,$0.00,1,,2006,,OT,17131,010517,01/03/05,
        Thanks for any ideas and help.

        Hopper

        6,684586
        Grand MasterGrand Master
        6,684586

          Jan 10, 2005#4

          Okay, I see, the date is part of the file name. So define a template (template 0) called for example "Filename" with template content [FILE_NAME].

          Now when you open for example uni_010105.txt, execute following macro commands to insert the name of the file into the file and reformat it to the date string you want, copy the date string to the clipboard and paste it later where you want it. Redo it for every file.

          Code: Select all

          InsertMode
          ColumnModeOff
          HexOff
          UnixReOff
          Top
          Template 0
          Top
          Find RegExp "uni_^([0-3][0-9]^)^([0-1][0-9]^)^([0-9][0-9]^)"
          Replace "^1/^2/^3"
          StartSelect
          SelectToTop
          Cut 
          EndSelect
          Add this to your existing macro. Hope this helps.
          Best regards from an UC/UE/UES for Windows user from Austria