Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - export results to tab-delimited file

Reply
 
Old 06-23-2009   #1 (permalink)
sneaky hamster


 
 

export results to tab-delimited file

Greetings,

I am running this command which does a nice job exporting everything to
a csv file:

Get-MailboxStatistics -Identity trmbx | select-object
LegacyDN,LastLoggedOnUserAccount,TotalItemSize,ItemCount,LastLogonTime,StorageLimitStatus,DatabaseName
| Export-Csv -Path trmbx.csv

Is there a simple way to export the same info into a tab-delimited file?

Thanks

My System SpecsSystem Spec
Old 06-24-2009   #2 (permalink)
RichS [MVP]


 
 

RE: export results to tab-delimited file

The answer is probably no in the immediate future. In PowerShell v2
export-csv has a -delimiter parameter that you could use for this

I guess you are using v1 on Exchange 2007 though.

--
Richard Siddaway
All scripts are supplied "as is" and with no warranty
PowerShell MVP
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"sneaky hamster" wrote:
Quote:

> Greetings,
>
> I am running this command which does a nice job exporting everything to
> a csv file:
>
> Get-MailboxStatistics -Identity trmbx | select-object
> LegacyDN,LastLoggedOnUserAccount,TotalItemSize,ItemCount,LastLogonTime,StorageLimitStatus,DatabaseName
> | Export-Csv -Path trmbx.csv
>
> Is there a simple way to export the same info into a tab-delimited file?
>
> Thanks
>
My System SpecsSystem Spec
Old 06-24-2009   #3 (permalink)
sneaky hamster


 
 

Re: export results to tab-delimited file

Thanks!

Yes correct - v1 on Exchange 2007.

RichS [MVP] wrote:
Quote:

> The answer is probably no in the immediate future. In PowerShell v2
> export-csv has a -delimiter parameter that you could use for this
>
> I guess you are using v1 on Exchange 2007 though.
>
My System SpecsSystem Spec
Old 06-24-2009   #4 (permalink)
Alex K. Angelopoulos


 
 

Re: export results to tab-delimited file

Here's a quick workaround for V1:

(gc .\data.csv | %{$_ -replace '","',"`"`t`""}) | sc .\data.csv

"sneaky hamster" <sneaky.hamster@xxxxxx> wrote in message
news:ez4eCKG9JHA.4376@xxxxxx
Quote:

> Greetings,
>
> I am running this command which does a nice job exporting everything to a
> csv file:
>
> Get-MailboxStatistics -Identity trmbx | select-object
> LegacyDN,LastLoggedOnUserAccount,TotalItemSize,ItemCount,LastLogonTime,StorageLimitStatus,DatabaseName
> | Export-Csv -Path trmbx.csv
>
> Is there a simple way to export the same info into a tab-delimited file?
>
> Thanks
My System SpecsSystem Spec
Old 06-24-2009   #5 (permalink)
Karl Mitschke


 
 

Re: export results to tab-delimited file

Hello sneaky,
Quote:

> Greetings,
>
> I am running this command which does a nice job exporting everything
> to a csv file:
>
> Get-MailboxStatistics -Identity trmbx | select-object
> LegacyDN,LastLoggedOnUserAccount,TotalItemSize,ItemCount,LastLogonTime
> ,StorageLimitStatus,DatabaseName | Export-Csv -Path trmbx.csv
>
> Is there a simple way to export the same info into a tab-delimited
> file?
>
> Thanks

Not currently, as Rich mentioned, but you can convert the file

Get-MailboxStatistics -Identity trmbx | Select-Object LegacyDN,LastLoggedOnUserAccount,TotalItemSize,ItemCount,LastLogonTime,StorageLimitStatus,DatabaseName
| Export-Csv -Path trmbx.tsv -NoTypeInformation
$string = Get-Content trmbx.tsv |out-string
$string.Replace(",","`t") |out-file c:\trmbx.tsv



My System SpecsSystem Spec
Old 06-24-2009   #6 (permalink)
Flowering Weeds


 
 

Re: export results to tab-delimited file


Mmm since this is the year of data parsing
and charting (and yes Regex is also included)
then FYI
Quote:

>
> Is there a simple way to export the same info into a tab-delimited file?
>
Remember, Windows PowerShell
is a Windows-based automation tool,
meant to pass "data"
from tool to tool, to tool,
until output (or whatever)!

So perhaps (like so many IT Pros) automate
a data parser tool within powershell.exe!

PS > LogParser.exe -h -o:tsv

Output format: TSV (TSV Output Format)
Formats fields as tab- or space- separated list of values

+Exchange +"Log Parser" - Bing
http://www.bing.com/search?q=%2BExch...2Log+Parser%22

+"tab" +"Log Parser" - Bing
http://www.bing.com/search?q=%2B%22t...2Log+Parser%22

And surely after all these years,
any PowerShell user can help
one automate Log Parser too!

As always enjoy the automation
of tools within the Windows-based,
..NET aware, WPF accessible,
admin's automation tool,
powershell.exe!


My System SpecsSystem Spec
Old 06-28-2009   #7 (permalink)
sneaky hamster


 
 

Re: export results to tab-delimited file

Thank you all!


sneaky hamster wrote:
Quote:

> Greetings,
>
> I am running this command which does a nice job exporting everything to
> a csv file:
>
> Get-MailboxStatistics -Identity trmbx | select-object
> LegacyDN,LastLoggedOnUserAccount,TotalItemSize,ItemCount,LastLogonTime,StorageLimitStatus,DatabaseName
> | Export-Csv -Path trmbx.csv
>
> Is there a simple way to export the same info into a tab-delimited file?
>
> Thanks
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Export results of script with cmd command to csv PowerShell
Open Tab Delimited File with Excel VB Script
comma delimited text file into database PowerShell
Way to Export Vista Reliability Results Vista account administration
Export-CliXml/Export-Csv: Change to Export-Object? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46