change format date

Find, replace, find in files, replace in files, regular expressions

change format date

Postby kids1951 » Sun Dec 24, 2006 11:55 pm

hello

i have this kind of data and i want juste to change de format date from for example:

19920720,0,17.09,17.26,16.04,16.92,668020
19920721,0,16.84,17.03,16.66,16.88,270280
19920722,0,16.81,17.11,16.31,16.61,454200
19920723,0,16.88,17.13,16.52,16.90,306560
19920724,0,16.79,16.88,16.58,16.72,296920
.........................................

to

07/20/1992,0,17.09,17.26,16.04,16.92,668020
07/21/1992,0,16.84,17.03,16.66,16.88,270280
07/22/1992,0,16.81,17.11,16.31,16.61,454200
07/23/1992,0,16.88,17.13,16.52,16.90,306560
07/24/1992,0,16.79,16.88,16.58,16.72,296920
......................................

so can ultra edit change the format date from YYYYMMDD to MM/DD/YYYY?
without i will lose a lot of time triying to do it manually
thks
User avatar
kids1951
Newbie
 
Posts: 2
Joined: Sun Dec 24, 2006 12:00 am

Re: change format date

Postby Bego » Mon Dec 25, 2006 7:18 pm

Hi dude,

well, you could write a macro or better: Use UE's column mode, since this is a simple fixed-column problem!

Press alt-c to switch column mode (and back)

You can then mark eg the first 4 columns for ALL rows and press ctrl-x.
Then paste it a bit to the back and so on.
Note: To Insert the /, just mark a single "column" from the to to the bottom and press /.
The sign is then inserted in all rows !

I'm sure you'll experiment a bit. Its more easy than to explain it.

rds Bego
User avatar
Bego
Master
Master
 
Posts: 357
Joined: Wed Nov 24, 2004 12:00 am
Location: Germany

Re: change format date

Postby kids1951 » Thu Dec 28, 2006 1:51 am

hi bego

i don't understand many of your explains
what do you mean by switch the column mode with the ctrl+c.
can you explain me all this with more,because it steal too complicated for me.lol
thanks
User avatar
kids1951
Newbie
 
Posts: 2
Joined: Sun Dec 24, 2006 12:00 am

Re: change format date

Postby Bego » Thu Dec 28, 2006 7:01 am

I did NO say ctrl-c, I said: alt-c.
I think if you now use alt-c and try it out you will get by with a little help from the manual. Search for "column mode".
Let we hear if you got it.

rds Bego
User avatar
Bego
Master
Master
 
Posts: 357
Joined: Wed Nov 24, 2004 12:00 am
Location: Germany

Re: change format date

Postby Mofi » Thu Dec 28, 2006 10:04 am

Column mode editing is one solution, a "simple" regular expression replace is a second one:

Following UltraEdit style regular expression replace all should do the job:

Find What: %^([12][0-9][0-9][0-9]^)^([01][0-9]^)^([0-3][0-9]^)
Replace With: ^2/^3/^1

Same regex with Unix/Perl style:

Find What: ^([12][0-9][0-9][0-9])([01][0-9])([0-3][0-9])
Replace With: \2/\3/\1
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Find/Replace/Regular Expressions