편집 기록

편집 기록
  • 프로필 nowp님의 편집
    날짜2021.09.23

    파이썬 텍스트파일에서 특정 패턴 다음 에 오는 텍스트 가져오기


    로그 파일을 받아와서 특정 패턴 뒤에 있는 값을 가져오고싶습니다. 아래 코드에서 detection_eval = 다음에 오는 값을 가져오고싶은데 ValueError : 'detection_eval = ' is not in list 라는 오류가 계속 나오고있습니다 뭐가문제일까요?

    텍스트파일 예제와 코드입니다.

    I0112 12:04:20.427652  8361 solver.cpp:546]     Test net output #0: detection_eval = 0.0274755…I0112 12:15:39.046685  8361 solver.cpp:546]     Test net output #0: detection_eval = 0.0610784
    
    file = open(r"C:\Users\영업지원\Desktop\03_parsing_csv_plot\vgg16_recog_107_20210112.log",'rt',encoding='UTF8')
    lines = file.readlines()
    for line in lines:
            item = line.split(" ")
            Detection_eval = item[item.index("detection_eval = ")+1]
    
  • 프로필 초보자님의 편집
    날짜2021.09.23

    파이썬 텍스트파일에서 특정 패턴 다음 에 오는 텍스트 가져오기


    로그 파일을 받아와서 특정 패턴 뒤에 있는 값을 가져오고싶습니다. 아래 코드에서 detection_eval = 다음에 오는 값을 가져오고싶은데 ValueError : 'detection_eval = ' is not in list 라는 오류가 계속 나오고있습니다 뭐가문제일까요? 텍스트파일 예제와 코드입니다.

    I0112 12:04:20.427652  8361 solver.cpp:546]     Test net output #0: detection_eval = 0.0274755…I0112 12:15:39.046685  8361 solver.cpp:546]     Test net output #0: detection_eval = 0.0610784
    
    file = open(r"C:\Users\영업지원\Desktop\03_parsing_csv_plot\vgg16_recog_107_20210112.log",'rt',encoding='UTF8')
    lines = file.readlines()
    for line in lines:
            item = line.split(" ")
            Detection_eval = item[item.index("detection_eval = ")+1]
    
  • 프로필 알 수 없는 사용자님의 편집
    날짜2021.09.23

    파이썬 텍스트파일에서 특정 패턴 다음 에 오는 텍스트 가져오기


    로그 파일을 받아와서 특정 패턴 뒤에 있는 값을 가져오고싶습니다. 아래 코드에서 detection_eval = 다음에 오는 값을 가져오고싶은데 ValueError : 'detection_eval = ' is not in list 라는 오류가 계속 나오고있습니다 뭐가문제일까요? 텍스트파일 예제와 코드입니다.
    I0112 12:04:20.427652 8361 solver.cpp:546] Test net output #0: detection_eval = 0.0274755…I0112 12:15:39.046685 8361 solver.cpp:546] Test net output #0: detection_eval = 0.0610784

    file = open(r"C:\Users\영업지원\Desktop\03_parsing_csv_plot\vgg16_recog_107_20210112.log",'rt',encoding='UTF8') lines = file.readlines() for line in lines: item = line.split(" ") Detection_eval = item[item.index("detection_eval = ")+1]