ZennoLab.Macros Assembly > ZennoLab.Macros Namespace > FileSystem Class : FileGetBlock Method |
Type: System.String
Path to the source file.
Type: System.String
Delimiter for text in the file.
Type: System.String
The line number after splitting into blocks.
Type: System.Boolean
true if remove the used block; otherwise, false.
Type: System.Boolean
true if need to remove empty source file after sampling; otherwise, false.
public static string FileGetBlock( string path, string blockSplitter, string numberOfLine, bool removeBlock, bool removeEmptyFile )
Type: System.String
Path to the source file.
Type: System.String
Delimiter for text in the file.
Type: System.String
The line number after splitting into blocks.
Type: System.Boolean
true if remove the used block; otherwise, false.
Type: System.Boolean
true if need to remove empty source file after sampling; otherwise, false.
Type: System.String
Text block after spliting and sampling.
string path = {pathToFile}; string blockSplitter = ":"; string numberOfLine = "random"; bool removeBlock = false; string result = FileSystem.FileGetBlock(path, blockSplitter, numberOfLine, removeBlock);
$path = {pathToFile}; $blockSplitter = ":"; $numberOfLine = "random"; $removeBlock = false; $result = FileSystem::FileGetBlock($path, $blockSplitter, $numberOfLine, $removeBlock);
Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.