here is my code, I have tried many things I found on the web and none seem to work. it imports to excel but is not broken into cells. I think it has something to do with the format of the mod1.txt file. I would be thankful for any advise.
#$tmpoutputmod = & "$racCommand" -r $tcp -u $racUser -p $Password getmodinfo | Out-File C:\temp\chassisinfo\mod.txt -width 100
Get-Content c:\temp\chassisinfo\mod.txt |select -Skip 6 | out-file c:\temp\chassisinfo\mod1.txt
$xla = New-Object -comobject Excel.Application
$xla.Visible = $True
$wtemp = $xla.Workbooks.Open("c:\temp\chassisinfo\mod1.txt")
here is the mod1.txt file, wish I could attach it but don't see that option.
<module> <presence> <pwrState> <health> <svcTag>
Chassis Present ON OK JPT2DZ1
Fan-1 Present ON OK
Fan-2 Present ON OK
Fan-3 Present ON OK
Fan-4 Present ON OK
Fan-5 Present ON OK
Fan-6 Present ON OK
Fan-7 Present ON OK
Fan-8 Present ON OK
Fan-9 Present ON OK
PS-1 Present Online OK
PS-2 Present Online OK
PS-3 Present Online OK
PS-4 Present Online OK
PS-5 Present Online OK
PS-6 Present Online OK
CMC-1 Present Standby OK N/A
CMC-2 Present Primary OK N/A
Switch-1 Not Present N/A N/A N/A
Switch-2 Not Present N/A N/A N/A
Switch-3 Present ON OK JPT5CZ1
Switch-4 Present ON OK JPT6CZ1
Switch-5 Present ON OK 3M3TFZ1
Switch-6 Present ON OK 3M3VFZ1
Server-1 Not Present N/A N/A N/A
Server-2 Not Present N/A N/A N/A
Server-3 Not Present N/A N/A N/A
Server-4 Not Present N/A N/A N/A
Server-5 Not Present N/A N/A N/A
Server-6 Not Present N/A N/A N/A
Server-7 Not Present N/A N/A N/A
Server-8 Not Present N/A N/A N/A
Server-9 Not Present N/A N/A N/A
Server-10 Not Present N/A N/A N/A
Server-11 Not Present N/A N/A N/A
Server-12 Not Present N/A N/A N/A
Server-13 Not Present N/A N/A N/A
Server-14 Not Present N/A N/A N/A
Server-15 Not Present N/A N/A N/A
Server-16 Not Present N/A N/A N/A
KVM Present ON OK
IO-Cable Present ON OK JPT2DZ1
FPC-Cable Present ON OK JPT2DZ1