clear line in text file
clear line in text file
clear line in text file
clear line in text file
clear line in text file
clear line in text file clear line in text file clear line in text file clear line in text file clear line in text file clear line in text file clear line in text file clear line in text file
clear line in text file clear line in text file
clear line in text file
Go Back  Xtreme Visual Basic Talk > > > clear line in text file


Reply
 
Thread Tools Display Modes
  #1  
Old 04-02-2010, 03:14 AM
RoYvB RoYvB is offline
Newcomer
 
Join Date: Mar 2010
Posts: 7
Default clear line in text file


{
OracleConnection oracleConect = null;
string connectStr = "User Id=Masaledsar;Password=password;Data Source=test.mlo.ug.com";
oracleConect = new OracleConnection(connectStr);
oracleConect.Open();

StreamReader objStreamReader;
objStreamReader = File.OpenText("C:\\test.txt");
objStreamReader.ReadLine();
string contents = null;
ArrayList arrText = new ArrayList();

while ((contents = objStreamReader.ReadLine()) != null)
{
string[] parts = contents.Split('\t');
OracleCommand cmd = oracleConect.CreateCommand();
cmd.Connection = oracleConect;
Console.WriteLine(contents);
arrText.Add(contents);

if (parts.Length>=12)
{
// insert to oracle

}




}
oracleConect.Close();
}




the program function is to read data by line from notepad and insert into oracle.
i juz made a code and its run successfully.

now im trying to clear all the line tranfer into new txt file.
any idea?
Reply With Quote
  #2  
Old 04-06-2010, 05:44 AM
JustinCase2 JustinCase2 is offline
Junior Contributor
 
Join Date: Apr 2006
Posts: 324
Default Not sure what you want to do

"clear all the line tranfer into new txt file"? Don't know what you meen. You want to move all the lines from your textfile into another textfile after you imported it to a DB? If so, the old textfile would now be empty, right? Then just rename and move the file, and create a new empty file with the same name as the original. If you for some reason can't do this, it should be easy to move the lines into a new file, but I'd first like to know if this is what you actually want to do.

BTW, that doesn't look like VB code...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
clear line in text file
clear line in text file
clear line in text file clear line in text file
clear line in text file
clear line in text file
clear line in text file clear line in text file clear line in text file clear line in text file clear line in text file clear line in text file clear line in text file
clear line in text file
clear line in text file
 
clear line in text file
clear line in text file
 
-->