0
$s = import-csv AAPL.csv
$s | gm
TypeName: System.Management.Automation.PSCustomObject
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Adj Close NoteProperty System.String Adj Close=103.739998
Close NoteProperty System.String Close=103.739998
Date NoteProperty System.String Date=2015-08-03
High NoteProperty System.String High=122.57
Low NoteProperty System.String Low=92.00
Open NoteProperty System.String Open=121.50
Volume NoteProperty System.String Volume=0
# $ts = $s.'Adj Close' //OK
# $ts = $s[ 0 .. $s.Count][3] //Anyway of doing this? suppose 'Adj Close' is on column 4.
我想知道是否可以通過位置編號/ id獲取NoteProperty值。我可以通過編號/編號而不是名稱獲取Powershell對象的noteproperty嗎?
我之所以這樣想,是因爲我可能遇到的財務數據沒有「調整關閉」的確切名稱,例如「最後關閉」,「關閉」,「調整關閉」等......在同一列並且可以使用相同的代碼進行分析。
謝謝!
請問'$ S |選擇-property *關閉*'爲此工作,還是更多樣化? – Eris
不完全,它將包含'調整關閉'和關閉列。但是,無論如何,你激勵我尋求答案!只要'$ s |選擇「特性」「調節關閉」,「價格」,「等等......」 – user3168078