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 라인.. ㅋㅋ
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
873 | System/OS | [linux] 초간단 SquirrelMail 설치/설정 (다람쥐 메일) | hooni | 2017.12.11 | 4473 |
872 | System/OS | [linux] CentOS Apache Httpd에 https 적용 | hooni | 2014.03.05 | 4485 |
871 | System/OS | [linux] resolv.con 초기화 되는 문제 | hooni | 2014.04.05 | 4626 |
870 | Develop | [ios] UUID 생성 + Key Chain 연동 | hooni | 2016.05.13 | 4675 |
869 | Develop | [ios] Objective-C 프로퍼티의 strong, weak, assign | hooni | 2014.03.17 | 4691 |
868 | Develop | [ios] UITableView 특정 Row만 Update | hooni | 2014.04.08 | 4783 |
867 | Develop | [android] 안드로이드 동영상 스트리밍 예제 2 | hooni | 2015.01.02 | 4825 |
866 | 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 | 4861 |
865 | Develop | [PHP] Mac OS에서 PHP 7 설치하기 | hooni | 2018.05.11 | 4892 |
864 | System/OS | [linux] awk 명령어 | hooni | 2014.03.11 | 4959 |
863 | Develop | [ios] Using protobuf(Protocol Buffers) on iPhone (iOS) | hooni | 2014.03.20 | 4988 |
862 | System/OS | [mac] 맥(OSX)에서 NTFS, 윈도우에서 HFS+ 사용하기 | hooni | 2014.03.12 | 5121 |