danusko Posted May 20, 2007 Share Posted May 20, 2007 Hi all, please can anyone show me just a little direction how can i creating this macro. I want create a GUI function (this i know), which will be show any information. This info will be from a few files. (this i know too) But i need reading the info according a condition. f.e. If is in this line in file number "5" then skip this info and go to read the next info. And if is this info "XY" write to this line on start "AAA". (i know write to the file only on end of file can you help me? Thanke you very much for . Link to comment Share on other sites More sharing options...
Gif Posted May 20, 2007 Share Posted May 20, 2007 (edited) Hi all, please can anyone show me just a little direction how can i creating this macro. I want create a GUI function (this i know), which will be show any information. This info will be from a few files. (this i know too) But i need reading the info according a condition. f.e. If is in this line in file number "5" then skip this info and go to read the next info. And if is this info "XY" write to this line on start "AAA". (i know write to the file only on end of file can you help me? Thanke you very much for . Well Case $msg = $fileopen $progopen = FileOpenDialog("Open", @desktopcommondir, "All files (*.*)") GUICtrlSetData($write, FileRead($progopen)) and for bypassing or changing the letters readed in the file use StringReplace() of cource it depends on what you want to read [ if ini or dld then iniread() and DLLcall ] Edited May 20, 2007 by c4nm7 Link to comment Share on other sites More sharing options...
Zedna Posted May 20, 2007 Share Posted May 20, 2007 (edited) Hi from Czech to Slovakia Look at my example, some texts I left in Czech you certainly will not have problem with it $file_in = FileOpen('file1.txt', 0) If $file_in = -1 Then MsgBox(0, "Chyba", "Nelze otevrit vstupni soubor.") Exit EndIf $file_out = FileOpen('file1.txt' & ".upr", 2) If $file_out = -1 Then MsgBox(0, "Chyba", "Nelze otevrit vystupni soubor.") Exit EndIf $radek = 0 While 1 $radek = $radek + 1 $line = FileReadLine($file_in) If @error = -1 Then ExitLoop ; konec souboru If $radek = 5 Then ContinueLoop ; skip line 5 $delka = StringLen($line) If StringLeft($line, 2) = 'XY' Then $line = StringLeft($line, 5) & Chr(9) & StringRight($line, $delka - 5) ; do some changes EndIf FileWriteLine($file_out, $line & @CRLF) Wend FileClose($file_in) FileClose($file_out) MsgBox(0, "HOTOVO", "Byl vytvoren vystupni soubor file1.txt.upr") Edited May 20, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
danusko Posted May 21, 2007 Author Share Posted May 21, 2007 Hi radek, super thanx for your help. I try it. ps: ké bych u vedel s autoitom delat jak ty kdyby to nelo, helfne mi jete? .) Hi from Czech to Slovakia Look at my example, some texts I left in Czech you certainly will not have problem with it $file_in = FileOpen('file1.txt', 0) If $file_in = -1 Then MsgBox(0, "Chyba", "Nelze otevrit vstupni soubor.") Exit EndIf $file_out = FileOpen('file1.txt' & ".upr", 2) If $file_out = -1 Then MsgBox(0, "Chyba", "Nelze otevrit vystupni soubor.") Exit EndIf $radek = 0 While 1 $radek = $radek + 1 $line = FileReadLine($file_in) If @error = -1 Then ExitLoop ; konec souboru If $radek = 5 Then ContinueLoop ; skip line 5 $delka = StringLen($line) If StringLeft($line, 2) = 'XY' Then $line = StringLeft($line, 5) & Chr(9) & StringRight($line, $delka - 5) ; do some changes EndIf FileWriteLine($file_out, $line & @CRLF) Wend FileClose($file_in) FileClose($file_out) MsgBox(0, "HOTOVO", "Byl vytvoren vystupni soubor file1.txt.upr") Link to comment Share on other sites More sharing options...
Gif Posted May 21, 2007 Share Posted May 21, 2007 (edited) Hi radek, super thanx for your help. I try it. ps: kéž bych už vedel s autoitom delat jak ty kdyby to neÅ¡lo, helfneÅ¡ mi jeÅ¡te? .)didn't i help, i meantioned FileRead() and StringReplace() thoughanywayedit: grammatical mistake !!!!!!!!!!!didnt i helpED!!!!!!!! lol Edited May 21, 2007 by c4nm7 Link to comment Share on other sites More sharing options...
Zedna Posted May 21, 2007 Share Posted May 21, 2007 ps: kéž bych už vedel s autoitom delat jak ty kdyby to nešlo, helfneš mi ješte? .)Jasně. Když tak mi klidně pošli PM.ZdravímFor english users: I like to help him :-) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
danusko Posted May 21, 2007 Author Share Posted May 21, 2007 didn't i help, i meantioned FileRead() and StringReplace() thoughanywayedit: grammatical mistake !!!!!!!!!!!didnt i helpED!!!!!!!! lolRadek wrote mi it, more detaily. I can it use immediately and easier. but you helped me too of course. thanke you very much. Link to comment Share on other sites More sharing options...
Zedna Posted May 21, 2007 Share Posted May 21, 2007 Hi radek, super thanx for your help. I try it. ps: kéž bych už vedel s autoitom delat jak ty kdyby to nešlo, helfneš mi ješte? .)I'm Zedna and not Radek :-) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
danusko Posted May 21, 2007 Author Share Posted May 21, 2007 (edited) I'm Zedna and not Radek :-)sorrry i saw in your script Radek and i thought its your nick )))absolut iracional but becomes ps: uz som to tak trochu skúsal a vyzerá to very funkcnedik Edited May 21, 2007 by danusko Link to comment Share on other sites More sharing options...
Uriziel01 Posted May 21, 2007 Share Posted May 21, 2007 Little offtop i see ;P p.s-może zaczniemy jeszcze po Polsku gadac co wy na to chlopaki ? ;D Link to comment Share on other sites More sharing options...
Zedna Posted May 21, 2007 Share Posted May 21, 2007 Little offtop i see ;P p.s-może zaczniemy jeszcze po Polsku gadac co wy na to chlopaki ? ;DCzech/Slovak language is almost the same but Polish is little differrent for me - but I can understand it somehow (something from context).But consider this is English forum and I don't know exactly if we can make here whole topics/post threads in other language.If you want send me PM (English or Polish) ... Resources UDF ResourcesEx UDF AutoIt Forum Search 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