PowerShell another possible way to convert text into a table _powershell

Source: Internet
Author: User

Copy Code code as follows:

$text = "
1 Dream West Tour 216406 2014-01-21 information film
2 furnace stone legend 15905 2014-01-24 test
3 new Dahua West Tour 214465 2002-08-01 public test
4 asked 11322 2006-04-22 of the public test
5 Loam 10094 2014-04-23 Beta
6 qq Xian Ling 10056 2014-06-06 Public test
7 Brilliant 10011 2010-09-17 public test
8 Q-Pass 9576 2014-06-27 Beta
9 Goddess of the three countries 9343 2014-06-28 Beta
10 Championship vs. 8809 2014-04-23 test
11 I want to seal the day 4447 2014-07-05 public test
12 Taoyuan will record 4324 2012-05-24
13 God 3899 2011-11-24 Test
14 Fairy Tales 3779 2013-07-20 Beta
15 Dream Sui Tang 3462 2014-07-11 public test
16 Peach Garden record 3289 2013-06-21 Beta
17 Condor 3112 2012-09-20 test
18 West Travel 2516 2012-08-31 Limited beta
19 Fantasy 22421 2009-10-22 Public test
203 countries chopped 2313 2010-04-28 beta "

$t 1=@ ()
$text. Split ("' N", [stringsplitoptions]::removeemptyentries) |
%{
$game = "" |select rank, game name, heat value, date, status, remark
$game. Rank =$_.split () [0]
$game. Game name =$_.split () [1]
$game. Heat value =$_.split () [2]
$game. Date =$_.split () [3]
$game. State =$_.split () [4]
$t 1+= $game
}
$t 1| Export-csv "Games.csv"-not-enc oem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.