简体   繁体   English

如何使用 C# 或 Vue.js 从文本文件中读取特定数据?

[英]How can I read specific data from text file using C# or Vue.js?

I want to read specific data from the text file shown below :我想从下面显示的文本文件中读取特定数据:

在此处输入图片说明 . .

How can I do this using C# or Vue.js?我如何使用 C# 或 Vue.js 做到这一点?

In C#, you can read all the lines using File.ReadAllLines() (see https://docs.microsoft.com/en-us/dotnet/api/system.io.file.readalllines?view=netcore-3.1 ).在 C# 中,您可以使用 File.ReadAllLines() 读取所有行(请参阅https://docs.microsoft.com/en-us/dotnet/api/system.io.file.readalllines?view=netcore-3.1 )。

Loop through the lines (or use a Linq Where() statement) until you find the one with "total."循环遍历这些行(或使用 Linq Where() 语句),直到找到带有“total”的那一行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM