Reading Columns & Output
Posted: 24 Jan 2013 20:17
hello,
I've created this basic script:
FOR /F "eol=; tokens=1-8 delims= " %%i in (c:\temp1\FileCheck.txt) do @echo %%i %%j %%k %%l %%m %%n %%o %%p >> c:\temp1\fileOutPut.txt
I used this command to produce this output: dir /t:caw /r /x /q /a /o:-g-ds >> c:\FileCheck.txt
FileCheck.txt has the following data in the text.
01/10/2013 08:04 PM <DIR> MICROS~1 WINDOZE7\OWNER Microsoft
01/04/2013 09:22 PM <DIR> WINDOZE7\OWNER VOS
01/04/2013 08:38 PM <DIR> BUILTIN\Administrators Adobe
12/29/2012 01:25 PM <DIR> BUILTIN\Administrators Ipswitch
12/29/2012 01:25 PM <DIR> WINDOZE7\OWNER .
12/29/2012 01:25 PM <DIR> WINDOZE7\OWNER ..
12/27/2012 11:58 PM <DIR> ICACLI~1 BUILTIN\Administrators ICAClient
12/27/2012 10:29 PM <DIR> JUNIPE~1 BUILTIN\Administrators Juniper Networks
12/27/2012 10:24 PM <DIR> BUILTIN\Administrators NVIDIA
12/27/2012 10:09 PM <DIR> BUILTIN\Administrators Mozilla
12/27/2012 10:07 PM <DIR> MACROM~1 BUILTIN\Administrators Macromedia
12/27/2012 09:22 PM <DIR> MALWAR~1 BUILTIN\Administrators Malwarebytes
12/27/2012 09:17 PM <DIR> IDENTI~1 WINDOZE7\OWNER Identities
04/12/2011 01:45 AM <DIR> MEDIAC~1 WINDOZE7\OWNER Media Center Programs
But when I want to use my batch file from above to read the columns, all the empty space / alignment is off an the true columns are not intact / the same.
fileOutPut.txt shows the following:
01/10/2013 08:04 PM <DIR> MICROS~1 NEUBYTES\iremotetech Microsoft
01/04/2013 09:22 PM <DIR> NEUBYTES\iremotetech VOS
01/04/2013 08:38 PM <DIR> BUILTIN\Administrators Adobe
12/29/2012 01:25 PM <DIR> BUILTIN\Administrators Ipswitch
12/29/2012 01:25 PM <DIR> NEUBYTES\iremotetech .
12/29/2012 01:25 PM <DIR> NEUBYTES\iremotetech ..
12/27/2012 11:58 PM <DIR> ICACLI~1 BUILTIN\Administrators ICAClient
12/27/2012 10:29 PM <DIR> JUNIPE~1 BUILTIN\Administrators Juniper Networks
12/27/2012 10:24 PM <DIR> BUILTIN\Administrators NVIDIA
12/27/2012 10:09 PM <DIR> BUILTIN\Administrators Mozilla
12/27/2012 10:07 PM <DIR> MACROM~1 BUILTIN\Administrators Macromedia
12/27/2012 09:22 PM <DIR> MALWAR~1 BUILTIN\Administrators Malwarebytes
12/27/2012 09:17 PM <DIR> IDENTI~1 NEUBYTES\iremotetech Identities
04/12/2011 01:45 AM <DIR> MEDIAC~1 NEUBYTES\iremotetech Media Center
I need help with my for loop to help keep the spacing the same; I want to eventually output each column, each row, data into its own position, I am planning on outputting the data to html display.
Just how do I keep all the empty slots in the column or row from being filled with the next column or row of data spilling into the empty space?
Please let me know if you need additional input?
v/r Booga73
I've created this basic script:
FOR /F "eol=; tokens=1-8 delims= " %%i in (c:\temp1\FileCheck.txt) do @echo %%i %%j %%k %%l %%m %%n %%o %%p >> c:\temp1\fileOutPut.txt
I used this command to produce this output: dir /t:caw /r /x /q /a /o:-g-ds >> c:\FileCheck.txt
FileCheck.txt has the following data in the text.
01/10/2013 08:04 PM <DIR> MICROS~1 WINDOZE7\OWNER Microsoft
01/04/2013 09:22 PM <DIR> WINDOZE7\OWNER VOS
01/04/2013 08:38 PM <DIR> BUILTIN\Administrators Adobe
12/29/2012 01:25 PM <DIR> BUILTIN\Administrators Ipswitch
12/29/2012 01:25 PM <DIR> WINDOZE7\OWNER .
12/29/2012 01:25 PM <DIR> WINDOZE7\OWNER ..
12/27/2012 11:58 PM <DIR> ICACLI~1 BUILTIN\Administrators ICAClient
12/27/2012 10:29 PM <DIR> JUNIPE~1 BUILTIN\Administrators Juniper Networks
12/27/2012 10:24 PM <DIR> BUILTIN\Administrators NVIDIA
12/27/2012 10:09 PM <DIR> BUILTIN\Administrators Mozilla
12/27/2012 10:07 PM <DIR> MACROM~1 BUILTIN\Administrators Macromedia
12/27/2012 09:22 PM <DIR> MALWAR~1 BUILTIN\Administrators Malwarebytes
12/27/2012 09:17 PM <DIR> IDENTI~1 WINDOZE7\OWNER Identities
04/12/2011 01:45 AM <DIR> MEDIAC~1 WINDOZE7\OWNER Media Center Programs
But when I want to use my batch file from above to read the columns, all the empty space / alignment is off an the true columns are not intact / the same.
fileOutPut.txt shows the following:
01/10/2013 08:04 PM <DIR> MICROS~1 NEUBYTES\iremotetech Microsoft
01/04/2013 09:22 PM <DIR> NEUBYTES\iremotetech VOS
01/04/2013 08:38 PM <DIR> BUILTIN\Administrators Adobe
12/29/2012 01:25 PM <DIR> BUILTIN\Administrators Ipswitch
12/29/2012 01:25 PM <DIR> NEUBYTES\iremotetech .
12/29/2012 01:25 PM <DIR> NEUBYTES\iremotetech ..
12/27/2012 11:58 PM <DIR> ICACLI~1 BUILTIN\Administrators ICAClient
12/27/2012 10:29 PM <DIR> JUNIPE~1 BUILTIN\Administrators Juniper Networks
12/27/2012 10:24 PM <DIR> BUILTIN\Administrators NVIDIA
12/27/2012 10:09 PM <DIR> BUILTIN\Administrators Mozilla
12/27/2012 10:07 PM <DIR> MACROM~1 BUILTIN\Administrators Macromedia
12/27/2012 09:22 PM <DIR> MALWAR~1 BUILTIN\Administrators Malwarebytes
12/27/2012 09:17 PM <DIR> IDENTI~1 NEUBYTES\iremotetech Identities
04/12/2011 01:45 AM <DIR> MEDIAC~1 NEUBYTES\iremotetech Media Center
I need help with my for loop to help keep the spacing the same; I want to eventually output each column, each row, data into its own position, I am planning on outputting the data to html display.
Just how do I keep all the empty slots in the column or row from being filled with the next column or row of data spilling into the empty space?
Please let me know if you need additional input?
v/r Booga73