플그래밍/오토핫키

[오토핫키 v1] 폴더 내 모든 텍스트 파일 합치기

훗티v 2021. 5. 29. 10:00
반응형

[오토핫키 v1] 폴더 내 모든 텍스트 파일 합치기

 

 

textfiles 폴더 내의 모든 텍스트파일 합치는 오토핫키 스크립트

- 실행 파일과 같은 폴더 위치에 'textfiles'폴더 생성 후 합치고자 하는 텍스트 파일 이동

 

 

코드 - 오토핫키 텍스트파일 합치기

myDir = %A_ScriptDir%\textfiles
outputFile = %A_ScriptDir%\OutputFile.txt
FileDelete, %outputFile%

Loop, %myDir%\*.txt

{

FileEncoding, UTF-8

  FileRead, aFileContents, %A_LoopFileFullPath% 
  FileAppend, %aFileContents%, %outputFile% 
  substring := "\"
  StringGetPos, sub, A_LoopFileFullPath, %substring%
  filename := SubStr(A_LoopFileFullPath, sub)
  Array := StrSplit(A_LoopFileFullPath, "\")
  Last := Array.MaxIndex()
  Final := % Array[Last]
  FileAppend, `r`n-----------------%Final%-----------------`r`n`r`n, %outputFile% 

}

 

 

실행파일 폴더 - 오토핫키 텍스트파일 합치기

- 오토핫키 실행 파일

- textfiles 폴더

 

 

textfiles 폴더 - 오토핫키 텍스트파일 합치기

- 텍스트 파일

 

 

mergetexts 실행- 오토핫키 텍스트파일 합치기

- 실행 시 OutputFile.txt 생성

- textfiles 폴더 내 모든 텍스트 파일이 합쳐진 파일

- 각 텍스트 파일의 끝을 "---------파일명---------"으로 구분

 

 

OutputFile.txt - 오토핫키 텍스트파일 합치기

 

 

다운로드 - 오토핫키 텍스트파일 합치기

mergetexts.exe
1.06MB

 

 

 

 

 

[플그래밍/오토핫키] - [오토핫키] 이미지서치 기초 (ImageSearch)

[플그래밍/오토핫키] - [오토핫키] 단축키로 단어 뜻 찾아보기 (크롬)

[플그래밍/오토핫키] - [오토핫키] 자동 종목 선정 - 화살표 찾기

[플그래밍/오토핫키] - [오토핫키] 폴더 내 모든 텍스트 파일 합치기

[플그래밍/오토핫키] - [오토핫키] 키입력시까지 반복하기

 

 

 

 

 

 

반응형