도움말 센터도움말 센터
텍스트 파일에 문서 쓰기
writeTextDocument(documents,filename)
writeTextDocument(documents,filename,'Append',true)
예제
writeTextDocument(documents,filename)은 지정된 텍스트 파일에 documents를 씁니다. 이 함수는 UTF-8 형식으로 각 단어 사이에 공백을 넣어 한 줄에 하나씩 문서를 씁니다.
documents
filename
writeTextDocument(documents,filename,'Append',true)는 덮어쓰는 대신 파일에 추가합니다.
모두 축소
텍스트 파일에 문서로 구성된 배열을 씁니다.
documents = tokenizedDocument([ "an example of a short sentence" "a second short sentence"])
documents = 2x1 tokenizedDocument: 6 tokens: an example of a short sentence 4 tokens: a second short sentence
filename = "documents.txt"; writeTextDocument(documents,filename)
한 번에 하나씩 문서를 추가하는 방법으로 문서로 구성된 배열을 텍스트 파일에 씁니다.
토큰화된 문서로 구성된 배열을 만듭니다.
첫 번째 문서를 파일에 씁니다.
filename = "documents.txt"; writeTextDocument(documents(1),filename)
extractFileText를 사용하여 파일의 내용을 표시합니다.
extractFileText
str = extractFileText(filename)
str = "an example of a short sentence"
텍스트 파일에 두 번째 문서를 추가합니다.
writeTextDocument(documents(2),filename,'Append',true)
str = "an example of a short sentence a second short sentence"
tokenizedDocument
입력 문서로, tokenizedDocument 배열로 지정됩니다.
파일 이름으로, string형 스칼라, 문자형 벡터 또는 문자형 벡터를 포함하는 1×1 셀형 배열로 지정됩니다.
데이터형: string | char | cell
string
char
cell
R2017b에 개발됨
extractFileText | extractHTMLText | readPDFFormData | tokenizedDocument
extractHTMLText
readPDFFormData
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office