Sign in to follow this  
Followers 0
sanhen

StringIsSpace ???

19 posts in this topic

#1 ·  Posted (edited)

hi. help me

1.txt The content is:

123456

123456

password --md5 $1$O2O$l9ljb7xdaegVfE/Pgy1HC/

123456

123456

I must 1.txt the 3rd line of replace be "password --md5 temp",

1.txt The result is

123456

123456

password --md5 temp

123456

123456

How realizesï¼ï¼ï¼

Troubled everybody. Extremely thank

Edited by sanhen

Share this post


Link to post
Share on other sites



hi. help me

1.txt The content is:

123456

123456

password --md5 $1$O2O$l9ljb7xdaegVfE/Pgy1HC/

123456

123456

I must 1.txt the 3rd line of replace be "password --md5 temp",

The result is

123456

123456

password --md5 temp

123456

123456

How realizes???

Troubled everybody. Extremely thank

:whistle: What!!!??? :P

Here's a stab at nothing making sense:

#include <array.au3>
$sString = FileRead(@DeskTopDir & '\txt.txt')
$aArray = StringRegExp($sString, '(?s)(?i)password --md5 (.*?)(?:\r|$)', 3)
_ArrayDisplay($aArray, 'Output')

You might be better off asking in your native tongue, and hope someone understands enough to answer you, or is polite enough to translate.


[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

Very sorry!!!

You may have misunderstood what I meant

msgbox Show

However, the text has not changed ah

Share this post


Link to post
Share on other sites

Very sorry!!!

You may have misunderstood what I meant

msgbox Show

However, the text has not changed ah

Well I showed you the MsgBox() because I still have no idea what you want. If that's what you want, erase the previous content of the file:
FileClose(FileOpen('1.txt', 2))oÝ÷ Ù8^
âµëazw°ríz{m¢Ø^~)^jëh×6FileWrite('1.txt', $sString)

[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

What I mean is that the new files into such

1.txt The result is

123456

123456

password --md5 temp

123456

123456

Not turned out the way

123456

123456

password --md5 temp

123456

123456

password --md5 temp

Is added directly, rather than change

Share this post


Link to post
Share on other sites

What I mean is that the new files into such

1.txt The result is

123456

123456

password --md5 temp

123456

123456

Not turned out the way

123456

123456

password --md5 temp

123456

123456

password --md5 temp

Is added directly, rather than change

Sorry, you're still not making sense to me, as I said before, say it in your native tongue on "exactly" what you want, and maybe someone will translate for you... or maybe someone here will understand what you want more.

[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

Sorry. Because I was using the machine translation. You may not understand. Oh but I mean, this is probably the change

123456

123456

password --md5 temp

123456

123456

This is the original:

123456

123456

password --md5 $1$O2O$l9ljb7xdaegVfE/Pgy1HC/

123456

123456

Understand?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Sorry. Because I was using the machine translation. You may not understand. Oh but I mean, this is probably the change

123456

123456

password --md5 temp

123456

123456

This is the original:

123456

123456

password --md5 $1$O2O$l9ljb7xdaegVfE/Pgy1HC/

123456

123456

Understand?

Yes, I copied your "original" in a file, and replaced it with your change (password --md5 temp) and it changed it fine with the example I provided. 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

#9 ·  Posted (edited)

This is the example I was referring too

$hFileLocationName = @DesktopDir & '\txt.txt'
$sString = FileRead($hFileLocationName)
$sString = StringRegExpReplace($sString, '(?s)(?i)password --md5 (.*?)(?:\r|$)', 'password --md5 temp' & @CR)
FileClose(FileOpen($hFileLocationName, 2))
FileWrite($hFileLocationName, $sString)
is that still what you don't want?

Edit:

Had to add @CR for the replacement.

Edit2:

Had md4 and not md5 :">

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

Very grateful

What do you MSN think is? You can talk and the next?

Share this post


Link to post
Share on other sites

Very grateful

What do you MSN think is? You can talk and the next?

I only answer questions here on the forum... others may be willing to "Big Brother Up" though.

[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

You do not think too much trouble, the better to increase your MSN would like to learn from you AU3

Share this post


Link to post
Share on other sites

You do not think too much trouble, the better to increase your MSN would like to learn from you AU3

No you wouldn't, the language barrier would end up driving me nuts, and I'd revert to my usual sarcastic self :whistle:

[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

This is the example I was referring too

$hFileLocationName = @DesktopDir & '\txt.txt'
$sString = FileRead($hFileLocationName)
$sString = StringRegExpReplace($sString, '(?s)(?i)password --md5 (.*?)(?:\r|$)', 'password --md5 temp' & @CR)
FileClose(FileOpen($hFileLocationName, 2))
FileWrite($hFileLocationName, $sString)
is that still what you don't want?

Edit:

Had to add @CR for the replacement.

Edit2:

Had md4 and not md5 :">

$sString = StringRegExpReplace($sString, '(?s)(?i)password --md5 (.*?)(?:\r|$)', 'password --md5 temp' & @CR)

'password --md5 temp'

temp For the numbers and letters will succeed

This is $sString = StringRegExpReplace($sString, '(?s)(?i)password --md5 (.*?)(?:\r|$)', 'password --md5 $1$3$rB0ztbxt67JtzZlgU/c1X/ ' & @CR)

And this is not :$1$3$rB0ztbxt67JtzZlgU/c1X/

why?

Share this post


Link to post
Share on other sites

'$' is an escape character...

$hFileLocationName = @DesktopDir & '\txt.txt'
$sString = FileRead($hFileLocationName)
$sString = StringRegExpReplace($sString, '(?s)(?i)password --md5 (.*?)(?:\r|$)', 'password --md5 \$1\$3\$rB0ztbxt67JtzZlgU/c1X/' & @CR)
FileClose(FileOpen($hFileLocationName, 2))
FileWrite($hFileLocationName, $sString)


[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

#16 ·  Posted (edited)

$pass=InputBox("GRUB MD5 Set up password tool ",@CR &"Please input your PIN start to be installed :","","*M15",250,150)

If @Error=1 Then Exit

If FileExists(@TempDir & "\pass.dat") Then FileDelete(@TempDir & "\pass.dat")

FileWrite(@TempDir & "\pass.dat",$pass)

FileInstall("md5.exe",@TempDir & "\md5.exe")

RunWait(@comspec & " /c md5.exe pass.dat md5.dat",@TempDir,@sw_hide)

$md5file=FileRead(@TempDir & "\md5.dat")

$menu=@HomeDrive & "\recycler\grub\menu.lst"

$md5='password --md5 '&$md5file

$sString = FileRead($menu)

$sString = StringRegExpReplace($sString,'(?s)(?i)password --md5 (.*?)(?:\r|$)', $md5 & @CR )

FileClose(FileOpen($menu, 2))

FileWrite($menu, $sString)

md5.dat is $1$9$XNKQ8HwCxZXQI6RLCWBrt/

$md5 Numbers and letters can be,

if $md5=$1$9$XNKQ8HwCxZXQI6RLCWBrt/

Then replace mistakes, Only shows $XNKQ8HwCxZXQI6RLCWBrt/

why?

Edited by sanhen

Share this post


Link to post
Share on other sites

$pass=InputBox("GRUB MD5 Set up password tool ",@CR &"Please input your PIN start to be installed :","","*M15",250,150)

If @Error=1 Then Exit

If FileExists(@TempDir & "\pass.dat") Then FileDelete(@TempDir & "\pass.dat")

FileWrite(@TempDir & "\pass.dat",$pass)

FileInstall("md5.exe",@TempDir & "\md5.exe")

RunWait(@comspec & " /c md5.exe pass.dat md5.dat",@TempDir,@sw_hide)

$md5file=FileRead(@TempDir & "\md5.dat")

$menu=@HomeDrive & "\recycler\grub\menu.lst"

$md5='password --md5 '&$md5file

$sString = FileRead($menu)

$sString = StringRegExpReplace($sString,'(?s)(?i)password --md5 (.*?)(?:\r|$)', $md5 & @CR )

FileClose(FileOpen($menu, 2))

FileWrite($menu, $sString)

md5.dat is $1$9$XNKQ8HwCxZXQI6RLCWBrt/

$md5 Numbers and letters can be,

if $md5=$1$9$XNKQ8HwCxZXQI6RLCWBrt/

Then replace mistakes, Only shows $XNKQ8HwCxZXQI6RLCWBrt/

why?

I gave you the answer...

See any difference from yours:

$1$3$rB0ztbxt67JtzZlgU/c1X/

And Mine:

\$1\$3\$rB0ztbxt67JtzZlgU/c1X/

????!!!!????


[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

Sorry Or not. Under this test can help you. Annex inside paper

Share this post


Link to post
Share on other sites

Sorry Or not. Under this test can help you. Annex inside paper

Look, I obviously don't know what you are talking about, my example that I've posted running it against your list, works exactly how I interpreted of what you wanted it to do.

I've showed where you are wrong, but you are starting to get under my skin with not showing anything or how you are using what I've provided. I've shown you what you had to do to get it to work right. \$ Not $ .... you'll need to explain yourself much better and post your code you are using from now on, for me to continue to help.


[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