Hi
I need to open flat files using C#.
I need to work very fast, but when I used StreamReader, This is very slow.
Anybody knows how to work FILES very fast using C#.
I need to read 3 millions of records at least a minute.
How can i access FILES very fast (flat files)?
Thanks for your help
Macisu 6 1119
Macisu,
Are you running a race or something? That is an awful amount of records
to be reading.
How are you processing them? Just saying that it is very slow isn't
really good enough, since we can't see how you are processing the stream
(there may be optimizations you can make which you aren't).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Macisu" <Ma****@discussions.microsoft.com> wrote in message
news:86**********************************@microsof t.com... Hi
I need to open flat files using C#. I need to work very fast, but when I used StreamReader, This is very slow.
Anybody knows how to work FILES very fast using C#. I need to read 3 millions of records at least a minute.
How can i access FILES very fast (flat files)?
Thanks for your help
Macisu
Check out this guy's comments on the FileStream class and large files. http://www.geekswithblogs.net/johnsperfblog
--
2004 and 2005 Microsoft MVP C#
Robbe Morris http://www.masterado.net
Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com. http://www.eggheadcafe.com/forums/merit.asp
"Macisu" <Ma****@discussions.microsoft.com> wrote in message
news:86**********************************@microsof t.com... Hi
I need to open flat files using C#. I need to work very fast, but when I used StreamReader, This is very slow.
Anybody knows how to work FILES very fast using C#. I need to read 3 millions of records at least a minute.
How can i access FILES very fast (flat files)?
Thanks for your help
Macisu
I need to load the file in SQL SERVER.
This file has information about savings accounts and is necesary to load
very fast for other tasks. For Now, I used bulk insert copy.
But, When i used Visual Basic 6, this is very fast using
Open File for input #1
etc.
why?
What can i do using c#?
"Nicholas Paldino [.NET/C# MVP]" wrote: Macisu,
Are you running a race or something? That is an awful amount of records to be reading.
How are you processing them? Just saying that it is very slow isn't really good enough, since we can't see how you are processing the stream (there may be optimizations you can make which you aren't).
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Macisu" <Ma****@discussions.microsoft.com> wrote in message news:86**********************************@microsof t.com... Hi
I need to open flat files using C#. I need to work very fast, but when I used StreamReader, This is very slow.
Anybody knows how to work FILES very fast using C#. I need to read 3 millions of records at least a minute.
How can i access FILES very fast (flat files)?
Thanks for your help
Macisu
Macisu,
Did you check the link that was posted in the other reply? It shows
some ways of using the FileStream that improve performance by quite a bit.
You also haven't shown how you are processing the file, and your
algorithm could be part of the problem as well.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Macisu" <Ma****@discussions.microsoft.com> wrote in message
news:C7**********************************@microsof t.com... I need to load the file in SQL SERVER.
This file has information about savings accounts and is necesary to load very fast for other tasks. For Now, I used bulk insert copy.
But, When i used Visual Basic 6, this is very fast using Open File for input #1 etc. why? What can i do using c#?
"Nicholas Paldino [.NET/C# MVP]" wrote:
Macisu,
Are you running a race or something? That is an awful amount of records to be reading.
How are you processing them? Just saying that it is very slow isn't really good enough, since we can't see how you are processing the stream (there may be optimizations you can make which you aren't).
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Macisu" <Ma****@discussions.microsoft.com> wrote in message news:86**********************************@microsof t.com... > Hi > > I need to open flat files using C#. > I need to work very fast, but when I used StreamReader, This is very > slow. > > Anybody knows how to work FILES very fast using C#. > I need to read 3 millions of records at least a minute. > > How can i access FILES very fast (flat files)? > > Thanks for your help > > Macisu
Inline.
Willy.
"Macisu" <Ma****@discussions.microsoft.com> wrote in message
news:C7**********************************@microsof t.com... I need to load the file in SQL SERVER.
This file has information about savings accounts and is necesary to load very fast for other tasks. For Now, I used bulk insert copy.
But, When i used Visual Basic 6, this is very fast using Open File for input #1 etc. why? What can i do using c#?
If you can do it using VB6,you can do it with C#, of course without seeing
any it's impossible to tell what issues you have.
I guess, the problem is not the file reading, but the DB insert's that are
slowing down the process.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Macisu,
Are you running a race or something? That is an awful amount of records to be reading.
How are you processing them? Just saying that it is very slow isn't really good enough, since we can't see how you are processing the stream (there may be optimizations you can make which you aren't).
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Macisu" <Ma****@discussions.microsoft.com> wrote in message news:86**********************************@microsof t.com... > Hi > > I need to open flat files using C#. > I need to work very fast, but when I used StreamReader, This is very > slow. > > Anybody knows how to work FILES very fast using C#. > I need to read 3 millions of records at least a minute. > > How can i access FILES very fast (flat files)? > > Thanks for your help > > Macisu
Macisu <Ma****@discussions.microsoft.com> wrote: I need to open flat files using C#. I need to work very fast, but when I used StreamReader, This is very slow.
Could you post a short but complete program which demonstrates the
problem?
See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Martin Bless |
last post by:
The good news:
Along with Python-2.4 comes really good news to Windows users. Yes,
you now CAN build extension modules yourself using the SAME C++
compiler and linker Python is built with...
|
by: Tom Lee |
last post by:
Hi,
I'm new to .NET 2003 compiler. When I tried to compile my
program using DEBUG mode, I got the following errors in the
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7
\include\xdebug...
|
by: Wayne Aprato |
last post by:
I have a client who is running several Access 97 databases that I have
written for them. They are about to upgrade to Access 2003. Is the
default file format of Access 2003 still Access 2000 the...
|
by: Lee Gillie |
last post by:
I have a VS6 project which I brought into VS .NET, and all has been
building fine. Then I upgraded to VS 2003 and I have one source which
will no longer compile. Any clues?
Compiling......
|
by: Jonathan Wilson |
last post by:
Is it possible to use vcbuild with the free MS compiler toolkit, as in can
someone with just the MS toolkit and no access to a copy of Visual Studio
itself use vcbuild to compile a Visual Studio...
|
by: Jonathan Wilson |
last post by:
Firstly, to get msvcrt.lib, install the .NET framework SDK. The version of
msvcrt.lib included there is the exact same one as comes with Visual Studio
..NET 2003.
There are some other things that...
|
by: noleander |
last post by:
I'm trying to get Vis C++ std to compile using /O2 optimizing flag. Many
people have suggested downloading the MS C++ 2003 Toolkit ... it supposedly
has C++ compiler bins that one could use.
I...
|
by: David Waz... |
last post by:
Moved an app from W/2000 Asp V1.0 to
W/2003, VS/2003, ASPV 1.1
Page runs a long job, uploading 2 large fixed length files
(300,000 rows) into SQL database. A process is run
against the data,...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |