Develop
2013.04.23 15:45
[c] 텍스트 파일(로그)을 정해진 라인 단위로 쪼개주는 코드
조회 수 7050 댓글 0
첨부 '1' |
---|
함수는 아래와 같음..
#include <stdio.h> #include <stdlib.h> #include <string.h> #define FILE_LINE_LEN 1024 #define FILE_NAME_LEN 256 #define SPLIT_LINE_STD 50000 int split_fname(char* filename, char* name, char* ext); int mysplit(char* sfilename, int critical);
[사용법]
명령어 파일명 (라인수)
예) split log.txt 500
예와 같이 실행할 경우 500라인 단위로 쪼개서 log0001.txt, log0002.txt ... 으로 저장해줌
라인수는 생략해도 됨.. 생략하면 기본 50000 라인.. ㅋㅋ
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
405 | Etc | [link] 유용한 사이트 링크. | hooni | 2013.08.19 | 71466 |
404 | System/OS | [linux] /etc/fstab 설정 방법.. ㅋㅋ | hooni | 2013.04.23 | 12084 |
403 | System/OS | [linux] apache, php, jsp 환경설정하기.. | hooni | 2003.04.23 | 15244 |
402 | System/OS | [linux] APM(apache, php, mysql) + gd 설치순서.. | hooni | 2003.04.23 | 18852 |
401 | System/OS | [linux] awk 명령어 | hooni | 2014.03.11 | 4957 |
400 | System/OS | [linux] CentOS 6.5 에서 "Bringing up interface eth0: Determining if ip address 121.78.127.197 is already in use for device eth0..." | hooni | 2014.04.05 | 4851 |
399 | System/OS | [linux] CentOS 6.x Cati 설치 (yum) | hooni | 2014.01.17 | 48596 |
398 | System/OS | [linux] CentOS Apache Httpd에 https 적용 | hooni | 2014.03.05 | 4483 |
397 | Develop | [linux] CentOS Apache 웹서버에 HTTPS 적용 | hooni | 2015.10.23 | 790 |
396 | System/OS | [linux] CentOS 에 APM 설치하기 | hooni | 2015.01.02 | 1696 |
395 | System/OS | [linux] CentOS 터미널 언어 설정(한글/영어) | hooni | 2013.12.22 | 18517 |
394 | Develop | [linux] crond 사용법.. ㅋㅋ | hooni | 2013.04.23 | 7246 |