Simmy Posted June 16, 2011 Share Posted June 16, 2011 Hi guys hope you are all well and can help.Guys hopefully you can clarify if what Im needing here is to understand more about the following"...What constitutes multi-dimensional arrays versus single arrays . ...How you get different data appearing on the same line in a delimited format as opposed to starting a new line.Im not entirely sure, but ill try and explain what im trying to do and hopefully you kind gurus will shed light on what you do in similar circumstances.================================================Scenario 1: Gettting a file list================================================Let's say I want to get a list of files from a folder and do the same thing...write this information to a file, so it looks like below:============================= data.txtd:\test\file1.txtd:\test\file2.txtd:\test\file3.txtHow would you write that information so that each new entry, was actually on the same line, so it would look like below:============================= data.txtd:\test\file1.txt, d:\test\file2.txt, d:\test\file3.txtAlso, would this be called on 1 dimensional array, since we are only talking about the "dimension" - filelist?================================================Scenario 2: Gettting cpu, memory etc in a list================================================Let's say I want to audit a machine, and get information about cpu, memory, etc, and write this information to a file.Instead of each type of data eg.cpu, memory, appearing on its own line, I wanted that data to appear comma-delimited on a single line, so maybe something like below:============================= data.txtcpu, 2GHz, memory, 1024MBSorry if im a bit vague here, and probably asking more than one question in the same one.Im trying to understand moreso, how you typically build or format data into a text file when you are talking about multiple types of information.I know this would vary for what your end goal is, but any help or examples would be of great help to myself and greatly appreciated. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 16, 2011 Share Posted June 16, 2011 Does this help you? $var1 = "d:\test\file1.txt" $var2 = "d:\test\file2.txt" $var3 = "d:\test\file3.txt" $var4 = $var1 & ', ' & $var2 & ', ' & $var3 ConsoleWrite($var4 & @LF) - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Simmy Posted June 16, 2011 Author Share Posted June 16, 2011 Thanks somdcomputerguy much appreciated. Link to comment Share on other sites More sharing options...
sleepydvdr Posted June 17, 2011 Share Posted June 17, 2011 As for scenario #2, how about something like this: #Include <WinAPI.au3> $cpu = @CPUArch $CPUSpeed = RegRead("HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "~MHz") $CPUSpeed = StringLeft($CPUSpeed, 3) $CPUSpeed = Round($CPUSpeed, 2) / 100 $Memory = MemGetStats() $Memory = StringLeft ($Memory[1], 3) $Memory = Round($Memory, 2) / 100 MsgBox(0, "", "CPU = " & $cpu & " Architecture" & " / " & $CPUSpeed & " GHz" & " / " & $Memory & " Gigs of RAM") #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
Simmy Posted June 17, 2011 Author Share Posted June 17, 2011 Hi Sleepydvdr, That's awesome thank you mate. 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