<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LeVeilleur.net &#187; Excel</title>
	<atom:link href="http://www.leveilleur.net/index.php/tag/excel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leveilleur.net</link>
	<description></description>
	<lastBuildDate>Thu, 03 Jun 2010 21:21:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PowerShell : Merge files with a particular extension</title>
		<link>http://www.leveilleur.net/index.php/2009/02/05/powershell-merge-file-of-a-particular-extension/</link>
		<comments>http://www.leveilleur.net/index.php/2009/02/05/powershell-merge-file-of-a-particular-extension/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 09:36:02 +0000</pubDate>
		<dc:creator>Christopher Keyaert</dc:creator>
				<category><![CDATA[powershell]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[grouper]]></category>
		<category><![CDATA[merge]]></category>

		<guid isPermaLink="false">http://www.leveilleur.net/?p=151</guid>
		<description><![CDATA[Hello,
Voici une fonction powershell vous permettant de regrouper/merge de tous les fichiers portant une extension particulière.
$source="C:\"
$extenstion ="*.csv"
$outputFile = "MyMergeFile.csv"
$blockTerminator = "ENDOFFILE"

function mergeFile ($source, $extenstion, $outputFile, $blockTerminator)
{

[System.IO.DirectoryInfo]$directoryInfo = New-Object System.IO.DirectoryInfo($source);
$rgFiles = $directoryInfo.GetFiles($extenstion);
$builder = New-Object System.Text.StringBuilder;

foreach ($fileInfo in $rgFiles)
	{
	[System.IO.FileStream]$fReader = $fileInfo.OpenRead();
	if (-not ($fileInfo -eq $null))
		{
		write $fileInfo.Name;
		$reader = New-Object System.IO.StreamReader($fReader);
		$builder.AppendLine($reader.ReadToEnd());
		$builder.AppendLine($blockTerminator);
		}
	}
if (-NOT $source.EndsWith('\'))
	{
 	$source = $source + '\';
	}

$outputFile = [...]]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>Voici une fonction powershell vous permettant de regrouper/merge de tous les fichiers portant une extension particulière.</p>
<pre>$source="C:\"
$extenstion ="*.csv"
$outputFile = "MyMergeFile.csv"
$blockTerminator = "ENDOFFILE"

function mergeFile ($source, $extenstion, $outputFile, $blockTerminator)
{

[System.IO.DirectoryInfo]$directoryInfo = New-Object System.IO.DirectoryInfo($source);
$rgFiles = $directoryInfo.GetFiles($extenstion);
$builder = New-Object System.Text.StringBuilder;

foreach ($fileInfo in $rgFiles)
	{
	[System.IO.FileStream]$fReader = $fileInfo.OpenRead();
	if (-not ($fileInfo -eq $null))
		{
		write $fileInfo.Name;
		$reader = New-Object System.IO.StreamReader($fReader);
		$builder.AppendLine($reader.ReadToEnd());
		$builder.AppendLine($blockTerminator);
		}
	}
if (-NOT $source.EndsWith('\'))
	{
 	$source = $source + '\';
	}

$outputFile = $source + $outputFile;
[System.IO.FileStream]$fWriter = New-Object System.IO.FileStream($outputFile, [System.IO.FileMode]::OpenOrCreate);
$writer = New-Object System.IO.StreamWriter($fWriter);
$writer.Write($builder.ToString());
$writer.Flush();
$writer.Close();
}

mergeFile $source $extenstion $outputFile $blockTerminator</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.leveilleur.net/index.php/2009/02/05/powershell-merge-file-of-a-particular-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell : Control Excel</title>
		<link>http://www.leveilleur.net/index.php/2009/02/03/powershell-control-excel/</link>
		<comments>http://www.leveilleur.net/index.php/2009/02/03/powershell-control-excel/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 21:16:06 +0000</pubDate>
		<dc:creator>Christopher Keyaert</dc:creator>
				<category><![CDATA[powershell]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://www.leveilleur.net/?p=143</guid>
		<description><![CDATA[Voici quelques bouts de code pour controler Microsoft Excel à partir de PowerShell
#Creation of the xls Sheet

$a = New-Object -comobject Excel.Application
$a.visible = $True

$MyWorkBook = $a.Workbooks.Add()
$MyWorksheets = $MyWorkBook.Worksheets.Item(1)
$i=1;

$MyWorksheets.Cells.Item(1,$i++) = "Server Name"
$MyWorksheets.Cells.Item(1,$i++) = "Host"
$MyWorksheets.Cells.Item(1,$i++) = "Cluster"

#Excel Sheet Format
$d = $MyWorksheets.UsedRange
$d.Interior.ColorIndex = 19
$d.Font.ColorIndex = 11
$d.Font.Bold = $True

$MyWorksheets.Cells.Item($intRow,$i++) = "OK"
$MyWorksheets.Cells.Item($intRow,$i-1).Interior.ColorIndex = 4

#Save the XLS page in CSV
$FileFormat=[Microsoft.Office.Interop.Excel.xlFileFormat]::xlCsv
if(test-path "$FileLocation\BocadaExport.csv"){Remove-Item "$FileLocation\BocadaExport.csv"}
$MyWorksheets.SaveAs("$FileLocation\BocadaExport.csv",$FileFormat)

#Quit [...]]]></description>
			<content:encoded><![CDATA[<p>Voici quelques bouts de code pour controler Microsoft Excel à partir de PowerShell</p>
<pre>#Creation of the xls Sheet

$a = New-Object -comobject Excel.Application
$a.visible = $True

$MyWorkBook = $a.Workbooks.Add()
$MyWorksheets = $MyWorkBook.Worksheets.Item(1)
$i=1;

$MyWorksheets.Cells.Item(1,$i++) = "Server Name"
$MyWorksheets.Cells.Item(1,$i++) = "Host"
$MyWorksheets.Cells.Item(1,$i++) = "Cluster"

#Excel Sheet Format
$d = $MyWorksheets.UsedRange
$d.Interior.ColorIndex = 19
$d.Font.ColorIndex = 11
$d.Font.Bold = $True

$MyWorksheets.Cells.Item($intRow,$i++) = "OK"
$MyWorksheets.Cells.Item($intRow,$i-1).Interior.ColorIndex = 4

#Save the XLS page in CSV
$FileFormat=[Microsoft.Office.Interop.Excel.xlFileFormat]::xlCsv
if(test-path "$FileLocation\BocadaExport.csv"){Remove-Item "$FileLocation\BocadaExport.csv"}
$MyWorksheets.SaveAs("$FileLocation\BocadaExport.csv",$FileFormat)

#Quit XLS
$excel.displayalerts = $False
$excel.quit()</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.leveilleur.net/index.php/2009/02/03/powershell-control-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
