
listar y buscar en txt por nombre y ciudad
Publicado por anonymous (1 intervención) el 10/10/2019 17:18:47
necesito listar por nombre y raza y buscar los nombre y ciudades que hay en el txt tengo este codigo que solo me lee lo que hay dentro y me lo saca por consola
*******************************************programa**********************************************************************************************
***************************************************** formato txt ********************************************************************************
*******************************************programa**********************************************************************************************
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace programa
{
class Program
{
static void Main(string[] args)
{
List<string> nombre= new List<string>();
List<string> raza= new List<string>();
using (StreamReader leer = new StreamReader(@"C:\prueba\animales.txt"))
{
var x= leer.ReadLine().Split(",");
nombre.Add(x[0]);
raza.Add(x[1]);
Console.ReadKey();
}
}
}
}
***************************************************** formato txt ********************************************************************************
1
2
3
urus,perro,6547
lambo,gato,6554
didi,perro,9874
Valora esta pregunta


0