# 연습문제2: 파일 처리 및 데이터 분석

## TCL 연습문제: 파일 처리 및 데이터 분석 📊

### 문제 설명

주어진 텍스트 파일에는 매일의 최고 기온이 저장되어 있습니다.

당신의 임무는 이 데이터를 읽고, 분석한 후, 결과를 새 파일에 저장하는 것입니다.

### 입력 파일 형식 (temperatures.txt)

파일의 각 줄은 다음 형식을 따릅니다:

```
YYYY-MM-DD,온도
```

입력파일: `temperatures.txt`

```
2023-01-01,5.2
2023-01-02,6.8
2023-01-03,4.5
2023-01-04,-0.7
2023-01-05,2.3
2023-01-06,7.1
2023-01-07,8.9
2023-01-08,3.2
2023-01-09,-2.1
2023-01-10,0.5
2023-01-11,1.8
2023-01-12,4.6
2023-01-13,6.3
2023-01-14,5.7
2023-01-15,-1.4
```

### 요구사항

1. `temperatures.txt` 파일을 읽습니다.
2. 다음 정보를 계산합니다:
   * 전체 기간의 평균 기온
   * 최고 기온과 해당 날짜
   * 최저 기온과 해당 날짜
   * 영하(0°C 미만)인 날의 수
3. 결과를 `temperature_analysis.txt` 파일에 저장합니다.
4. 에러 처리: 파일이 존재하지 않거나 읽을 수 없는 경우 적절한 에러 메시지를 출력합니다.

### 출력 파일 형식 (temperature\_analysis.txt)

분석 결과를 다음 형식으로 저장합니다:

```
평균 기온: [평균값]°C
최고 기온: [최고값]°C ([날짜])
최저 기온: [최저값]°C ([날짜])
영하 날짜 수: [일수]일
```

### 추가 요구사항

* 소수점 이하 2자리에서 반올림하여 표시합니다.
* 출력 날짜 형식은 다음과 같습니다. MM-DD
* 스크립트는 터미널에서 실행할 수 있어야 합니다.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vlsi-korea.gitbook.io/chase-tcl/2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
