Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GarganTexternal tools
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anne-Laure Thomas Derepas
GarganTexternal tools
Commits
1fc005a2
Commit
1fc005a2
authored
Jul 10, 2024
by
Marie FU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Element to tsv and correct clean csv
parent
093cc8b3
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
277 deletions
+24
-277
Clean_CSV_to_TSV.py
Streamlit/pages/Clean_CSV_to_TSV.py
+3
-5
Element_to_TSV.py
Streamlit/pages/Element_to_TSV.py
+20
-269
csvFileOP.py
Streamlit/src/csvFileOP.py
+1
-3
No files found.
Streamlit/pages/Clean_CSV_to_TSV.py
View file @
1fc005a2
...
...
@@ -176,8 +176,7 @@ if STATE.file is not None:
toStartOfFile
(
STATE
.
file
)
STATE
.
fileData
=
""
addColumnsNamestoTSV
(
STATE
.
file
,
STATE
.
encoding
,
STATE
.
separator
,
STATE
.
columnMap
)
STATE
.
fileData
=
addColumnsNamestoTSV
(
STATE
.
file
,
STATE
.
encoding
,
STATE
.
separator
,
STATE
.
columnMap
)
toStartOfFile
(
STATE
.
file
)
...
...
@@ -236,8 +235,7 @@ if STATE.file is not None:
errors
+=
file
+
": "
+
STATE
.
general_text_dict
[
'err_columns'
]
+
"
\n
"
else
:
STATE
.
fileData
=
""
addColumnsNamestoTSV
(
STATE
.
currentFile
,
STATE
.
encoding
,
STATE
.
separator
,
STATE
.
columnMap
)
STATE
.
fileData
=
addColumnsNamestoTSV
(
STATE
.
currentFile
,
STATE
.
encoding
,
STATE
.
separator
,
STATE
.
columnMap
)
# set a variable to check if there are any detected errors
# and construction of correct file content while checking
...
...
@@ -250,7 +248,7 @@ if STATE.file is not None:
else
:
with
open
(
STATE
.
zipDir
.
name
+
"/CleanCSV/"
+
file
[:
-
4
]
+
".tsv"
,
"w"
)
as
file
:
file
.
write
(
STATE
.
fileData
.
replace
(
"
\"
"
,
"”"
))
if
STATE
.
allFileData
!
=
""
:
if
STATE
.
allFileData
=
=
""
:
STATE
.
allFileData
=
STATE
.
fileData
else
:
STATE
.
allFileData
+=
STATE
.
fileData
[
81
:]
...
...
Streamlit/pages/Element_to_TSV.py
View file @
1fc005a2
This diff is collapsed.
Click to expand it.
Streamlit/src/csvFileOP.py
View file @
1fc005a2
...
...
@@ -7,8 +7,6 @@ Authors:
from
io
import
StringIO
import
typing
from
anyio
import
open_file
from
numpy
import
isin
from
streamlit.runtime.uploaded_file_manager
import
UploadedFile
import
streamlit
as
st
from
src.gerneralFileOP
import
*
...
...
@@ -237,7 +235,7 @@ def addColumnsNamestoTSV(file : UploadedFile|str, encoding : str, separator : st
filecontent
=
StringIO
(
file
.
getvalue
()
.
decode
(
encoding
))
.
read
()
.
split
(
"
\n
"
)[
0
]
.
split
(
separator
)
elif
isinstance
(
file
,
str
):
with
open
(
file
,
"r"
,
encoding
=
encoding
)
as
f
:
filecontent
=
f
.
read
()
filecontent
=
f
.
read
()
.
split
(
separator
)
for
name
in
filecontent
:
if
name
in
columnMap
.
keys
():
if
fileData
!=
""
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment