Compare commits
3 Commits
2e26cd688f
...
37d787ce74
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37d787ce74 | ||
|
|
2cb5a4e505 | ||
|
|
7ae5096685 |
23
addBindings.jq
Normal file
23
addBindings.jq
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
.
|
||||||
|
# Sort first
|
||||||
|
| walk(
|
||||||
|
if type == "object" and has("tags") then
|
||||||
|
.tags |= sort_by(.name)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
# so object positions are predictable
|
||||||
|
| .tags[3].tags[1].tags as $baseData
|
||||||
|
| walk(
|
||||||
|
# Removes .Tags.Controller Tags from the plcName parameter
|
||||||
|
if type == "object" and has("plcName") then
|
||||||
|
.plcName.value |= rtrimstr(".Tags.Controller Tags")
|
||||||
|
elif type == "object" and has("plcname") then
|
||||||
|
.plcname.value |= rtrimstr(".Tags.Controller Tags")
|
||||||
|
end
|
||||||
|
)
|
||||||
|
# and can be used as the base line to setup the other objects
|
||||||
|
| walk(
|
||||||
|
if type == "object" and .name? == "Data" then
|
||||||
|
.tags = $baseData
|
||||||
|
end
|
||||||
|
)
|
||||||
7
big_merge.ps1
Normal file
7
big_merge.ps1
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
Write-Output "BIG MERGE!!"
|
||||||
|
Set-Content -Path "FTOptix_Combined.csv" "Location,Site,PLCName,SymbolName"
|
||||||
|
Get-ChildItem "FTOptix_Import*.csv" -Name | % {
|
||||||
|
Get-Content $_ |
|
||||||
|
Select -Skip 1 |
|
||||||
|
Add-Content -Path "FTOptix_Combined.csv"
|
||||||
|
}
|
||||||
4
countTypes.jq
Normal file
4
countTypes.jq
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.
|
||||||
|
| .tags
|
||||||
|
| map(.typeId)
|
||||||
|
| unique
|
||||||
31
csv_merge.ps1
Normal file
31
csv_merge.ps1
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
$list =
|
||||||
|
"SCP_EG2102_15",
|
||||||
|
"SCP_EG2102_12_A11",
|
||||||
|
"SCP_EG2102_13_A21",
|
||||||
|
"SCP_EG2102_10_B11",
|
||||||
|
"SCP_EG2102_11_B21",
|
||||||
|
"SCP_EG2102_08_C11",
|
||||||
|
"SCP_EG2102_09_C21",
|
||||||
|
"SCP_EG2102_06_D11",
|
||||||
|
"SCP_EG2102_07_D21",
|
||||||
|
"SCP_EG2102_04_E11",
|
||||||
|
"SCP_EG2102_05_E21",
|
||||||
|
"SCP_EG2102_02_F11",
|
||||||
|
"SCP_EG2102_03_F21",
|
||||||
|
"SCP_EG2102_14_R11",
|
||||||
|
"SCP_EG2102_01_R21"
|
||||||
|
|
||||||
|
function Combine-Csv {
|
||||||
|
param (
|
||||||
|
$sufix
|
||||||
|
)
|
||||||
|
|
||||||
|
Write-Output "Writing FTOptix_Combined_$sufix.csv"
|
||||||
|
Set-Content -Path "FTOptix_Combined_$sufix.csv" "Location,Site,PLCName,SymbolName"
|
||||||
|
Get-Content "./FTOptix_Combined.csv" |
|
||||||
|
where { $_ -match $sufix } |
|
||||||
|
add-content -Path "FTOptix_Combined_$sufix.csv"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output "Writing to $($list.Count) files"
|
||||||
|
$list | foreach { Combine-Csv -sufix $_ }
|
||||||
5
tag_sorter.jq
Normal file
5
tag_sorter.jq
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
walk(
|
||||||
|
if type == "object" and has("tags") then
|
||||||
|
.tags |= sort_by(.name)
|
||||||
|
end
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user