sanhen Posted March 17, 2007 Share Posted March 17, 2007 (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 March 17, 2007 by sanhen Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 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 What!!!??? 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. 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. Link to comment Share on other sites More sharing options...
sanhen Posted March 17, 2007 Author Share Posted March 17, 2007 Very sorry!!! You may have misunderstood what I meant msgbox Show However, the text has not changed ah Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 Very sorry!!! You may have misunderstood what I meant msgbox Show However, the text has not changed ahWell 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) 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. Link to comment Share on other sites More sharing options...
sanhen Posted March 17, 2007 Author Share Posted March 17, 2007 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 What I mean is that the new files into such 1.txt The result is123456 123456 password --md5 temp123456123456Not turned out the way 123456 123456 password --md5 temp123456123456password --md5 tempIs added directly, rather than changeSorry, 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. 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. Link to comment Share on other sites More sharing options...
sanhen Posted March 17, 2007 Author Share Posted March 17, 2007 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? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 (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 temp123456123456This is the original:123456 123456 password --md5 $1$O2O$l9ljb7xdaegVfE/Pgy1HC/123456123456Understand?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 March 17, 2007 by SmOke_N 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. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 (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 March 17, 2007 by SmOke_N 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. Link to comment Share on other sites More sharing options...
sanhen Posted March 17, 2007 Author Share Posted March 17, 2007 Very grateful What do you MSN think is? You can talk and the next? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 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. 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. Link to comment Share on other sites More sharing options...
sanhen Posted March 17, 2007 Author Share Posted March 17, 2007 You do not think too much trouble, the better to increase your MSN would like to learn from you AU3 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 You do not think too much trouble, the better to increase your MSN would like to learn from you AU3No you wouldn't, the language barrier would end up driving me nuts, and I'd revert to my usual sarcastic self 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. Link to comment Share on other sites More sharing options...
sanhen Posted March 18, 2007 Author Share Posted March 18, 2007 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? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 18, 2007 Moderators Share Posted March 18, 2007 '$' 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) 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. Link to comment Share on other sites More sharing options...
sanhen Posted March 19, 2007 Author Share Posted March 19, 2007 (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 ExitIf 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 March 19, 2007 by sanhen Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 19, 2007 Moderators Share Posted March 19, 2007 $pass=InputBox("GRUB MD5 Set up password tool ",@CR &"Please input your PIN start to be installed :","","*M15",250,150)If @Error=1 Then ExitIf 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/????!!!!???? 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. Link to comment Share on other sites More sharing options...
sanhen Posted March 19, 2007 Author Share Posted March 19, 2007 Sorry Or not. Under this test can help you. Annex inside paper Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 19, 2007 Moderators Share Posted March 19, 2007 Sorry Or not. Under this test can help you. Annex inside paperLook, 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. 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now