Sign in to follow this  
Followers 0
n9mfk9

how to replace a date?

10 posts in this topic

Hi All

I have a sting with the date

5/20/2007

the date changes so what wood be the best way to do a string replace based on the format i tried using * it did not work

thanks beau

Share this post


Link to post
Share on other sites



You need to be more specific. What is your goal? What code have you tried? Perhaps a StringBetween and then a StringReplace would work.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

I have a date

I cold be any date

the / are the only part that does not change

is there a way to wilcard a sting replace

/ /

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I have a date

I cold be any date

the / are the only part that does not change

is there a way to wilcard a sting replace

/ /

You are making no sense.

Why don't you show the an example of what you are doing or want to do.

Edit:

I should say this... and maybe since you're not making sense to me, the help file will make sense to you... you can use wild cards with "string" replacement by using StringRegExpReplace().

That's about as much help as anyone could give you with what you've provided to help you thus far... Kind of like going to the doctor for a vasectomy and walking out a unich ... Both give you the result you wanted, but not what you had in mind :whistle:

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

here is wthat i wet to replace

Created on: 7/11/2007

but the date changes by the day so tomorrow it cold be 8/11/2006 so what would i look for

Share this post


Link to post
Share on other sites

StringRegExpReplace($sString, 'Created on: \d{1,2}\/\d{1,2}\/\d{4}', 'Created on: ' & @MON & '\/' & @MDAY & '\/' & @YEAR)

If that doesn't work, then you need to provide ALOT more... we don't even know how in the hell you're using this.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Your still not making a ton of sense... but both Mike and SmOke N have given you a very good answer of StringRegExpReplace().

I'm sure if you search around the forum for date and StringRegExp(with or without the replace) you'll come up with good examples...

EDIT: hmm in the amount of time it took me to respond, SmOke came in, figured out the correct stringregexpreplace syntax, posted it, and left... hmm... not... good

Edited by someone

While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

how to replace a date?

Ask her sister out...?

I have a sting with the date

You will if she hears you asking her sister out!

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

StringRegExpReplace($sString, 'Created on: \d{1,2}\/\d{1,2}\/\d{4}', 'Created on: ' & @MON & '\/' & @MDAY & '\/' & @YEAR)

If that doesn't work, then you need to provide ALOT more... we don't even know how in the hell you're using this.

Thanks that worked

I have a ?

if i had two line of text that were the same

is there a way to have StringRegExpReplace replace only the scent line

thanks

Share this post


Link to post
Share on other sites

Thanks that worked

I have a ?

if i had two line of text that were the same

is there a way to have StringRegExpReplace replace only the scent line

thanks

Turtles

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0