Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DATA_FILE := "data.ini"
- allAssets := getAllAssets()
- lines := ""
- filePath := "geo_자산관리_데이터_" . A_Year . "-" . A_Mon . "-" . A_DD . ".csv"
- for no, asset in allAssets
- {
- line := ""
- line .= asset.no . ","
- line .= asset.type . ","
- line .= asset.location . ","
- line .= asset.department . ","
- line .= asset.user . ","
- line .= asset.connectedPC . ","
- line .= asset.comNum . ","
- line .= asset.assetNum . ","
- line .= asset.note . ","
- line .= asset.info . ","
- line .= asset.history . "`n"
- lines .= line
- }
- FileAppend, % lines, % filePath
- MsgBox done!
- getAllAssets()
- {
- global DATA_FILE
- IniRead, assetNos, % DATA_FILE
- if !StrLen(assetNos)
- return false
- allAssets := {}
- Loop, Parse, assetNos, `n
- allAssets[A_LoopField] := getKeysAndValuesInSection(A_LoopField)
- return allAssets
- }
- getKeysAndValuesInSection(section)
- {
- global DATA_FILE
- IniRead, contentOfSection, % DATA_FILE, % section
- sectionKeysAndValues := {}
- Loop, Parse, contentOfSection, `n
- if RegExMatch(A_LoopField, "^(?<key>.+?)=(?<value>.*)$", _)
- sectionKeysAndValues[_key] := _value
- return sectionKeysAndValues
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement