.NET Logo
Welcome Guest Search | Active Topics | Members | Log In | Register

การ export,import csv file Options · View
paedotnet
Posted: Sunday, September 28, 2008 9:03:22 PM

Rank: มือเทพ
Groups: Member

Joined: 12/6/2007
Posts: 345
Location: bkk

การ export,import csv (Comma-Separated Value) file
ในการสร้าง export csv จะใช้คำสั่ง
Export-CSV
ตัวอย่าง

Get-Process | Export-CSV  d:\csvtest\test.csv

ในตัวอย่างโค้ดดัานบนนี้จะเป็นการสร้าง ไฟล์ .csv พร้อมกับ metadata ดังนั้น
ถ้าต้องการสร้างไฟล์แบบไม่มี metadata ก็สามารถเขียนได้ดังนี้

Get-Process | Export-CSV d:\aaaa\test_without_metadata.csv -NoTypeInformation

การ import csv
จะใช้คำสั่ง Import-CSV ดังนี้

Import-CSV d:\aaaa\test.csv


[With great power comes great responsibility]
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.


Sponsored by