0
새로운 Google 문서 도구로 새로운 문서를 만들고 싶습니다. 기본적으로 나는 유닉스 명령에 해당하고 싶은 :텍스트 docs 1,2,3을 4로 연결해야합니다. 어떻게?
고양이 1.TXT 2.txt 3.txt> 4.txt
나는에서이 작업을 수행하는 가장 좋은 방법을 알아낼 수 없습니다 Apps 스크립트 설명서. 아무도 모를거야?
// ... code omitted
var entries = [];
while (files.hasNext()) {
var file = files.next();
var name = file.getName();
if (file.getOwner().getName() != 'My Name') continue
var re = /Pattern I am looking for - \d\d/g;
if (name.match(re) == null) continue;
entries.push({"Name" : name, "File" : file});
}
entries.sort(function(a,b) { return a.Name.localeCompare(b.Name); });
// Open the Full.txt file and add each file into it in sequence.
var fullDoc = DocumentApp.create('Full.txt');
entries.forEach(function(e) {
var contents = e.File.getAs('text/plain');
// Haven't yet gotten to sticking contents into the target file
// because content retrieval itself fails with the message:
// "Converting from application/vnd.google-apps.document to text/plain
// is not supported. (line 51, file "DocMerge")"
return;
});
감사 :
나는 다음을 시도했다. 문서의 내용을 검색 할 수 있도록-av
검색/연구 노력에 대한 자세한 정보를 추가하십시오. 참조 [ask]. –
[DocumentApp 's] (https://developers.google.com/apps-script/reference/document/document-app) [Body Class] (https://developers.google.com/apps-script/)를 사용해 보겠습니다. (https://developers.google.com/apps-script/reference/document/body#getText())를 [DriveApp 's] (https : // developers. google.com/apps-script/reference/drive/drive-app) 파일 [setContent()] (https://developers.google.com/apps-script/reference/drive/file#setContent (String)) –
거기 있습니다. 파일에서 본문을 가져 오는 방법이 아닌 것 같습니다. 내가 가진 것은 File 객체들의 목록이다. –