ZennoLab Assemblies Documentation
FileGetBlock Method
See Also  Example Send Feedback
ZennoLab.Macros Assembly > ZennoLab.Macros Namespace > FileSystem Class : FileGetBlock Method
path

Type: System.String

Path to the source file.

blockSplitter

Type: System.String

Delimiter for text in the file.

numberOfLine

Type: System.String

The line number after splitting into blocks.

removeBlock

Type: System.Boolean

true if remove the used block; otherwise, false.

removeEmptyFile

Type: System.Boolean

true if need to remove empty source file after sampling; otherwise, false.

Glossary Item Box

Gets text block from the file

Syntax

C# 
public static string FileGetBlock( 
   string path,
   string blockSplitter,
   string numberOfLine,
   bool removeBlock,
   bool removeEmptyFile
)

Parameters

path

Type: System.String

Path to the source file.

blockSplitter

Type: System.String

Delimiter for text in the file.

numberOfLine

Type: System.String

The line number after splitting into blocks.

removeBlock

Type: System.Boolean

true if remove the used block; otherwise, false.

removeEmptyFile

Type: System.Boolean

true if need to remove empty source file after sampling; otherwise, false.

Return Value

Type: System.String

Text block after spliting and sampling.

Example

The following example shows call the FileGetBlock method.
C#Copy Code
string path = {pathToFile};
string blockSplitter = ":";
string numberOfLine = "random";
bool removeBlock = false;
string result = FileSystem.FileGetBlock(path, blockSplitter, numberOfLine, removeBlock);
PHPCopy Code
$path = {pathToFile};
$blockSplitter = ":";
$numberOfLine = "random";
$removeBlock = false;
$result = FileSystem::FileGetBlock($path, $blockSplitter, $numberOfLine, $removeBlock);

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.