Jump to content

Recommended Posts

Posted

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.shtml

Thanks

Daniel

123.txt

Posted

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.

Posted

Thanks man

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.

<{POST_SNAPBACK}>

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...