-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathCSV_open.py
More file actions
45 lines (33 loc) · 1.04 KB
/
Copy pathCSV_open.py
File metadata and controls
45 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- coding: utf-8 -*-
"""
Created on Tue May 26 20:20:53 2015
Text matching
@author: Solo
"""
import os
import re
import glob
import numpy as np # noqa: F401 (kept for the loadtxt snippet below)
os.chdir(r"C:\Users\solo\Dropbox\Python")
path = r"C:\Users\solo\Dropbox\Python\XS_table2.txt"
# open the csv file in excel and change the decimal places to none.
from numpy import genfromtxt
f = open('XS_table2.txt', 'r')
data = f.read()
data_split = re.split((r'\t'), data)
d = np.loadtxt(path, delimiter="\t")
# NOTE: original scratch loop referenced an undefined `reader`;
# kept as a comment for reference.
# table = []
# for row in reader:
# print(re.split((r"\t"), b))
# a = 'adsfjdhfksdf\tdjlfhksdf'
# b = str(row)[2:-2]
os.chdir(r"C:\Users\solo\Dropbox\Python\HEC-RAS_Models")
zips = glob.glob("*.zip")
TP37 = list([0]*len(zips))
for i, zip_name in enumerate(zips):
print(i, zip_name)
TP37[i] = re.split(r'_', zip_name)[0]
os.chdir(r"C:\Users\solo\Dropbox\Python\HEC-RAS_Models\extracted")
g01s = glob.glob("*.g01")