나는 매주 강의 계획을 위해 목록으로 저장할 강의 테이블에서 자료를 가져오고 싶다. (그들은 csv에서 읽힐 것이다) 그래서 강의 계획서는 50 개의 목록이다. 챕터와 라텍스는 4 학년 때 1 주일에 2 레슨, 6 학년 때 3 레슨의 공간이 있습니다. 첫 레슨을 시작하고 첫 번째 토큰을 고수하고 다음 토큰을 붙이고 싶습니다. . . 지금 내 코드는regex 목록에서 바꾸기
여기math6 = ['chapter1', 'chapter2', 'chapter3', 'chapter1-3test']
math4= ['chapter1.1', 'chapter1.2-3', 'chapter2']
\begin{tabular}{|p{0.7in}|p{0.8in}|p{2.2in}|p{.9in}|p{2.6in}|p{1.6in}|}
6${}^{th}$ Math \newline M\newline & _math6_&
6${}^{th}$ Math \newline W \newline & _math6_ &
6${}^{th}$ Math \newline F \newline & _math6_ &
4${}^{th}$ Math \newline M\newline & & _math4_ &
4${}^{th}$ Math \newline W\newline & & _math4_ &
\end{tabular}
나에게
#contents of file1
# Really long Latex
#File that has
# geography, geography, mary, tom, susan, geography
#that I want to replace
#read file1 in as a string, replace, save again
#contents of file1
# Really long Latex
#File that has
# physics, physics, mary, tom, susan, physics
#that I want to replace
#read file1 in as a string, replace, save again
#contents of file1
# Really long Latex
#File that has
# hairdressing, hairdressing, mary, tom, susan, hairdressing
#that I want to replace
#read file1 in as a string, replace, save again
#contents of file1
# Really long Latex
#File that has
# torah, torah, mary, tom, susan, torah
#that I want to replace
#read file1 in as a string, replace, save again
정확한 질문은 무엇입니까 그래서 우리는 콜백 공장이 필요 ? 당신이 그것을 분명하게 말하면 대답하기가 훨씬 쉬울 것입니다. 또한 가능한 한 많이 작업하고있는 도메인과 구체적 문제를 분리시켜야합니다. 작은 문제 (예 : 문자열 분할)에 대해서만 답변하기 위해 큰 그림 (일정 만들기)을 연구하고 싶지는 않습니다. . – metakermit