dkwokgs Posted October 12, 2004 Share Posted October 12, 2004 Hi there,I am new to array. I am trying to read a txt and extract first line and all line after "Application:" (see attached) in to another txt file and then import in excel. There are thousands of same type of file generate from psinfo for indiviual machine on the network. Is there a good example of how to use? Please advise.Tried reading the file.au3 but still cannot figure out.Psinfo --> http://www.sysinternals.com/ntw2k/freeware/psinfo.shtmlThanksDaniel123.txt Link to comment Share on other sites More sharing options...
scriptkitty Posted October 12, 2004 Share Posted October 12, 2004 You can try this, at least it might point you in a direction. $file="123.txt" $x=Stringsplit(StringReplace(FileRead($file,FileGetSize($file)),@lf,""),@cr) $start=0 for $i=1 to $x[0] if $start=1 then msgbox(1,"",$x[$i]) if StringLeft($x[$i],13)="Applications:" then $start=1 next $x[] is the array, I have it mark $start when it finds your first word. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
dkwokgs Posted October 13, 2004 Author Share Posted October 13, 2004 Thanks manYou can try this, at least it might point you in a direction.$file="123.txt" $x=Stringsplit(StringReplace(FileRead($file,FileGetSize($file)),@lf,""),@cr) $start=0 for $i=1 to $x[0] if $start=1 then msgbox(1,"",$x[$i]) if StringLeft($x[$i],13)="Applications:" then $start=1 next$x[] is the array, I have it mark $start when it finds your first word.<{POST_SNAPBACK}> 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