Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
seigot committed Sep 23, 2024
1 parent b9e9527 commit dc0a5f4
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ocr/split-test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2024-09-20 18:45:36.655772+00:00 UTC,HR:0,RR:0,SPO2:0,HRV:0,BP:0/0
2024-09-20 18:45:36.810700+00:00 UTC,HR:0,RR:0,SPO2:0,HRV:0,BP:0/0
2024-09-20 18:45:36.973694+00:00 UTC,HR:0,RR:0,SPO2:0,HRV:0,BP:0/0
5 changes: 5 additions & 0 deletions ocr/split-test2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#session_id datetime frameNum timeStamp frameUsed hr dbp sbp resp eda source
#2.02E+13 2024-08-07 19:16:05:405691 9 6494.869 10 87.50211 70.92965 119.4948 12.68703 7.251212 webcam
#2.02E+13 2024-08-07 19:17:09:1580 5 6266.286 10 94.79957 83.24557 117.3883 13.35948 8.794392 webcam
#2.02E+13 2024-08-07 19:17:10:44284 15 7361.822 10 88.24873 71.05246 114.8953 12.47777 4.636355 webcam
#2.02E+13 2024-08-07 19:17:11:139989 25 8465.407 10 88.24873 71.05246 114.8953 12.47777 4.636355 webcam
49 changes: 49 additions & 0 deletions ocr/test4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#分割して1秒毎に出力
#2024-09-20 18:45:36.655772+00:00 UTC,HR:0,RR:0,SPO2:0,HRV:0,BP:0/0
#2024-09-20 18:45:36.810700+00:00 UTC,HR:0,RR:0,SPO2:0,HRV:0,BP:0/0
#2024-09-20 18:45:36.973694+00:00 UTC,HR:0,RR:0,SPO2:0,HRV:0,BP:0/0
#1秒毎に出力
#
#session_id datetime frameNum timeStamp frameUsed hr dbp sbp resp eda source
#2.02E+13 2024-08-07 19:16:05:405691 9 6494.869 10 87.50211 70.92965 119.4948 12.68703 7.251212 webcam
#2.02E+13 2024-08-07 19:17:09:1580 5 6266.286 10 94.79957 83.24557 117.3883 13.35948 8.794392 webcam
#2.02E+13 2024-08-07 19:17:10:44284 15 7361.822 10 88.24873 71.05246 114.8953 12.47777 4.636355 webcam
#2.02E+13 2024-08-07 19:17:11:139989 25 8465.407 10 88.24873 71.05246 114.8953 12.47777 4.636355 webcam
#
#時間フォーマット

# split()とかスライスを使って、文字列を分割する
import csv
filename = "split-test.csv"
with open(filename, 'r') as csvfile:
csvreader = csv.reader(csvfile)
for row in csvreader:
#STR="YYYY-MM-DD HH:MM:SS.SSSSSS+00:00 UTC,XX:0,YY:0,ZZZZ:0,AAA:0,BB:0/0"
# STR_SPLIT=STR.split(",")
STR_SPLIT=row
print(STR_SPLIT)
print(STR_SPLIT[0])
print("XX", STR_SPLIT[1][3:])
print("YY", STR_SPLIT[2][3:])
# YYYY-MM-DD HH:MM:SS.SSSSSS+00:00 UTC
# XX 0
# YY 0

print("-----")
# ---
import csv
filename = "split-test2.csv"
with open(filename, 'r') as csvfile:
csvreader = csv.reader(csvfile, delimiter='\t')
for row in csvreader:
STR_SPLIT=row
print(STR_SPLIT)
STR_SPLIT_2=STR_SPLIT[1].split(" ")
STR_SPLIT_3=STR_SPLIT_2[-1].split(":")
STR_SPLIT_4=STR_SPLIT_3[:-1]
print(str(STR_SPLIT_4[2:3]))
# print("XX", STR_SPLIT[5])
# print("YY", STR_SPLIT[8])
# YYYY-MM-DD HH:MM:SS.SSSSSS+00:00 UTC
# XX 0
# YY 0

0 comments on commit dc0a5f4

Please sign in to comment.