rwtxt

package
v0.0.0-...-4b0c422 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2024 License: MulanPSL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFromAllTXT

func ReadFromAllTXT[T any](folderPath string) ([][]T, error)

ReadFromAllTXT 读取指定文件夹下的所有 .txt 文件,并将每个文件解析为结构体切片,最终返回一个二维切片

func ReadFromTXT

func ReadFromTXT[T any](filepath string) ([]T, error)

ReadFromTXT 读取文件并将数据解析为结构体切片 注意,假设每行字段以空格分隔

func Save2TXT

func Save2TXT[T any](filepath string, my []T) error

Save2TXT 将结构体切片保存到文本文件,假设每行字段以空格分隔

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL