Syed23 Posted October 21, 2010 Share Posted October 21, 2010 Hi Friends, I have a text file with the single word information(like., BitlockerON). I would like to read this information from the text file with the function (File Read and FileReadLine) but it is not consistent as i expected. Does anyone have an idea how to read the text file consistently or do we have any other function for it...Thanks in advance.Regards,K.Syed Ibrahim. Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 21, 2010 Moderators Share Posted October 21, 2010 syedibrahim87,but it is not consistent as i expectedIn what way is the reading of the file "not consistent"? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Syed23 Posted October 22, 2010 Author Share Posted October 22, 2010 (edited) syedibrahim87,In what way is the reading of the file "not consistent"? M23Global $BitValue = FileRead("C:\temp\Bitlock.txt")_Bit($BitValue)Func _Bit($BitValue) If $BitValue == "YES" Then MsgBox(0,"Test",$BitValue) ElseIf $BitValue == "EncryptionPercentage" Then MsgBox(0,"Test",$BitValue) Else MsgBox(0,"Test",$BitValue) EndIfEndFuncIf i use it in a sample program the conditions works fine. But if i use the same function in 1000 line code it is not working ... only the Else part works not the If or elseif part.. Am i making clear... can you help me ?For your reference i have attached the text file. you can modify that file accordingly and you can check it.. Edited October 22, 2010 by syedibrahim87 Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 22, 2010 Moderators Share Posted October 22, 2010 syedibrahim87,Apologies, I missed your reply earlier today. Blame the dynamic forum! Of course you will not find the specific "YES|EncryptionPercentage|NO" text doing it that way. FileRead reads in the entire text of the file - so asking if the whole text == "something short" will never work if the file is 1000 lines long. What we need to do is find a way to identify the particular part of the file which is likely to contain the text you want to identify. Although "EncryptionPercentage" is pretty likely to be unique, the same cannot be said for "YES" and "NO". Could you please post a copy of the file in question (or at least the part which includes the text you are looking for) so we can see if there is something we can use as an anchor for the search? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Syed23 Posted October 27, 2010 Author Share Posted October 27, 2010 Melba23, No Problem. I am glad that you are helping me. some how i fixed the issue, but i don't how it is. As you asked i have attached my entire script below. please have a look. Thank you,Regards,K.Syed Ibrahim. Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font] 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