সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ফাইল ইটারেটর
একটি পুনরাবৃত্তিকারী যা স্ক্রিপ্টগুলিকে ফাইলগুলির একটি সম্ভাব্য বড় সংগ্রহের উপর পুনরাবৃত্তি করতে দেয়৷ Drive App বা একটি Folder থেকে ফাইল পুনরাবৃত্তিকারীগুলি অ্যাক্সেস করা যেতে পারে৷
// Log the name of every file in the user's Drive.constfiles=DriveApp.getFiles();while(files.hasNext()){constfile=files.next();Logger.log(file.getName());}
একটি টোকেন পায় যা পরবর্তী সময়ে এই পুনরাবৃত্তি পুনরায় শুরু করতে ব্যবহার করা যেতে পারে। এই পদ্ধতিটি কার্যকর যদি একটি এক্সিকিউশনে একটি পুনরাবৃত্ত প্রক্রিয়াকরণ সর্বোচ্চ কার্যকর করার সময় অতিক্রম করে। ধারাবাহিকতা টোকেন সাধারণত এক সপ্তাহের জন্য বৈধ।
প্রত্যাবর্তন
String - একটি ধারাবাহিকতা টোকেন যা টোকেন তৈরি হওয়ার সময় পুনরাবৃত্তিকারীতে থাকা আইটেমগুলির সাথে এই পুনরাবৃত্তি পুনরায় শুরু করতে ব্যবহার করা যেতে পারে
has Next()
next() কল করলে একটি আইটেম ফেরত আসবে কিনা তা নির্ধারণ করে।
প্রত্যাবর্তন
Boolean — true যদি next() একটি আইটেম ফেরত দেয়; false না হলে
next()
ফাইল বা ফোল্ডারের সংগ্রহে পরবর্তী আইটেমটি পায়। কোনো আইটেম অবশিষ্ট না থাকলে একটি ব্যতিক্রম নিক্ষেপ করুন।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-07-25 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eFileIterator allows scripts to iterate over a large collection of files within Google Drive, accessible via \u003ccode\u003eDriveApp\u003c/code\u003e or a \u003ccode\u003eFolder\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to check for more files (\u003ccode\u003ehasNext()\u003c/code\u003e), retrieve the next file (\u003ccode\u003enext()\u003c/code\u003e), and manage long iterations with continuation tokens (\u003ccode\u003egetContinuationToken()\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetContinuationToken()\u003c/code\u003e helps to resume iterations that might exceed execution time limits, with tokens typically valid for a week.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ehasNext()\u003c/code\u003e returns \u003ccode\u003etrue\u003c/code\u003e if there are more files to iterate, allowing scripts to control the loop.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003enext()\u003c/code\u003e retrieves the subsequent file in the collection, throwing an exception if none remain.\u003c/p\u003e\n"]]],[],null,["FileIterator\n\nAn iterator that allows scripts to iterate over a potentially large collection of files. File\niterators can be accessed from [DriveApp](/apps-script/reference/drive/drive-app) or a [Folder](/apps-script/reference/drive/folder).\n\n```javascript\n// Log the name of every file in the user's Drive.\nconst files = DriveApp.getFiles();\nwhile (files.hasNext()) {\n const file = files.next();\n Logger.log(file.getName());\n}\n``` \n\nMethods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------|-------------------------------------------|-------------------------------------------------------------------------|\n| [getContinuationToken()](#getContinuationToken()) | `String` | Gets a token that can be used to resume this iteration at a later time. |\n| [hasNext()](#hasNext()) | `Boolean` | Determines whether calling [next()](#next()) will return an item. |\n| [next()](#next()) | [File](/apps-script/reference/drive/file) | Gets the next item in the collection of files or folders. |\n\nDetailed documentation \n\n`get``Continuation``Token()` \nGets a token that can be used to resume this iteration at a later time. This method is useful\nif processing an iterator in one execution would exceed the maximum execution time.\nContinuation tokens are generally valid for one week.\n\nReturn\n\n\n`String` --- a continuation token that can be used to resume this iteration with the items that\nremained in the iterator when the token was generated\n\n*** ** * ** ***\n\n`has``Next()` \nDetermines whether calling [next()](#next()) will return an item.\n\nReturn\n\n\n`Boolean` --- `true` if [next()](#next()) will return an item; `false` if not\n\n*** ** * ** ***\n\n`next()` \nGets the next item in the collection of files or folders. Throws an exception if no items\nremain.\n\nReturn\n\n\n[File](/apps-script/reference/drive/file) --- the next item in the collection"]]