Backup senica-RVO48 on 16.10.2025
This commit is contained in:
parent
33a0c880db
commit
fa5565e650
60 changed files with 22965 additions and 0 deletions
43
RVO48/createNode.py
Executable file
43
RVO48/createNode.py
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
print("zaciname")
|
||||
import re, json
|
||||
|
||||
search_str = '|'
|
||||
final = []
|
||||
counter = 1
|
||||
with open("/home/unipi/flowserver/databases/nodes.table", 'r') as file:
|
||||
# with open("/home/rasta5man/dev/oms/flowserver/databases/nodes.table", 'r') as file:
|
||||
# Read each line in the file
|
||||
for line in file:
|
||||
# Print each line
|
||||
line = line.strip()
|
||||
print(line)
|
||||
if counter != 1:
|
||||
i = [m.start() for m in re.finditer(re.escape(search_str), line)]
|
||||
node = line[ i[0] + 1 : i[1] ]
|
||||
tbname = line[ i[3] + 1 : i[4] ]
|
||||
final.append({node:tbname})
|
||||
counter += 1
|
||||
print(json.dumps(final))
|
||||
f = open("/home/unipi/flowserver/databases/nodes_original/nodes_original.table", "w")
|
||||
f.write(json.dumps(final))
|
||||
f.close()
|
||||
|
||||
|
||||
#
|
||||
# # ``d`` has to be replaced with a different character
|
||||
# old_character = "'"
|
||||
#
|
||||
# # ``t`` will replace ``d`
|
||||
# new_character = '"'
|
||||
# resultant_string = 0;
|
||||
# with open("/home/unipi/flowserver/databases/nodes_original/nodes_original.table", 'r') as file:
|
||||
# for line in file:
|
||||
# resultant_string = re.sub("'", '"', line)
|
||||
#
|
||||
# resultant_string = re.sub(" ", "", resultant_string)
|
||||
# print(resultant_string)
|
||||
#
|
||||
# f = open("/home/unipi/flowserver/databases/nodes_original/nodes_original.table", "w")
|
||||
# f.write(str(resultant_string))
|
||||
# f.close()
|
||||
#
|
||||
Loading…
Add table
Add a link
Reference in a new issue