ho un piccolo problema in C#,ora vengo subito al sodo :
1 - confrontare due file con estensione .txt
2 - scrivere un terzo file,sempre con estensione .txt,contenente le righe differenti dei due files
Ovviamente ringrazio tutti per il vostro aiuto
![Pernacchia :P](./images/smilies/icon_razz.gif)
Moderatori: Anthony47, Triumph Of Steel, archimede
fc
using System;
using System.Data;
using System.Data.OleDb;
using System.Collections.Generic;
using System.Text;
namespace access_insert_file
{
class Program
{
public static void Main(string[] args)
{
int counter = 0;
string line;
System.IO.StreamReader file =
new System.IO.StreamReader(@"C:\WriteText.txt");
OleDbConnection thisConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db2.mdb");
thisConnection.Open();
while((line = file.ReadLine()) != null)
{
System.Console.WriteLine (line);
OleDbCommand thisCommand = thisConnection.CreateCommand();
thisCommand.CommandText = "Insert into T1(F1) values(('" + line + "'))";
OleDbDataReader thisReader = thisCommand.ExecuteReader();
thisReader.Close();
counter++;
}
thisConnection.Close();
file.Close();
System.Console.WriteLine("");
System.Console.WriteLine("There were {0} lines.", counter);
System.Console.ReadLine();
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}
}
Aggiungere testo contenuto in specifica cella su file pdf Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 7 |
Errore 1004 su macro salva file come mht - mhtml Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 4 |
Macro copia dati colonne non contigue su un altro file excel Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 5 |
VLC - unire file .mts della videocamera Autore: valyfilm |
Forum: Audio/Video e masterizzazione Risposte: 2 |
Visitano il forum: Nessuno e 8 ospiti