TextFieldParser.SetFieldWidths メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TextFieldParser.SetFieldWidths メソッドの意味・解説 

TextFieldParser.SetFieldWidths メソッド

メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。

リーダーの区切り記号を指定された値に設定し、フィールドの種類を FixedWidth に設定します。

名前空間: Microsoft.VisualBasic.FileIO
アセンブリ: Microsoft.VisualBasic (microsoft.visualbasic.dll 内)
構文構文

Public Sub SetFieldWidths ( _
    ParamArray fieldWidths As Integer()
 _
)
Dim instance As TextFieldParser
Dim fieldWidths As Integer()

instance.SetFieldWidths(fieldWidths)
public void SetFieldWidths (
    params int[] fieldWidths
)
public:
void SetFieldWidths (
    ... array<int>^ fieldWidths
)
public void SetFieldWidths (
    int[] fieldWidths
)
public function SetFieldWidths (
    ... fieldWidths : int[]
)

パラメータ

fieldWidths

Integer の配列。

解説解説
使用例使用例

この例では、テキスト フィールド パーサーを開いて、フィールドの幅を 5 に設定しています。

Using FileReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser("C:\logs\test.log")
    FileReader.SetFieldWidths(5)
End Using

パス C:\logs\test.log は、実際に解析するファイルの名前とパスに置き換えてください。

次の例では、テキスト フィールド パーサーを開き、フィールド幅を 5、10、および可変長として定義しています。

Using MyReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser("C:\logs\test.log")
    MyReader.SetFieldWidths(5, 10, -1)
End Using

パス C:\logs\test.log は、実際に解析するファイルの名前とパスに置き換えてください。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TextFieldParser クラス
TextFieldParser メンバ
Microsoft.VisualBasic.FileIO 名前空間
SetFieldWidths
その他の技術情報
TextFieldParser.SetFieldWidths メソッド
TextFieldParser オブジェクト
TextFieldParser オブジェクトによるテキスト ファイルの解析
TextFieldParser.SetDelimiters メソッド



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「TextFieldParser.SetFieldWidths メソッド」の関連用語

TextFieldParser.SetFieldWidths メソッドのお隣キーワード

   

英語⇒日本語
日本語⇒英語
   



TextFieldParser.SetFieldWidths メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS