서점 데이터 이해하기
먼저 서점 데이터 파일을 살펴보는 것으로 시작해 보겠습니다. customers.txt와 books.txt라는 두 개의 파일이 있습니다.
먼저 customers.txt 파일의 내용을 확인해 봅시다:
cat /home/labex/project/customers.txt
다음과 유사한 출력이 표시되어야 합니다:
ID,Name,Age,Email
1,John Doe,25,john.doe@email.com
2,Jane Smith,35,jane.smith@email.com
3,Lily Chen,30,lily.chen@email.com
4,Andy Brown,22,andy.brown@email.com
이제 books.txt 파일을 살펴보겠습니다:
cat /home/labex/project/books.txt
출력 결과는 다음과 같을 것입니다:
ISBN,Title,Author,Price
978-1234567890,The Great Adventure,Alice Writer,19.99
978-2345678901,Mystery in the Woods,Bob Author,24.99
978-3456789012,Cooking Basics,Carol Chef,15.99
978-4567890123,Science Explained,David Scientist,29.99
이 파일들은 고객과 도서에 대한 다양한 필드를 포함하고 있는 쉼표 구분 값 (CSV) 형식입니다.
예상되는 출력이 보이지 않거나 오류가 발생하면 다음 사항을 확인하세요:
- 올바른 디렉토리 (
/home/labex/project) 에 있는지 확인합니다.
ls -l 명령어를 실행하여 파일이 존재하는지 확인합니다.
- 파일이 없는 경우 수동으로 생성하거나 실습 관리자에게 문의해야 할 수 있습니다.