473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Writing into a file in chunks

Hi there,

I need to reduce the time while writing into a file as i have more than 300K records to write -currently it takes more than 4 hrs as we write one record after record now.

We have a module that creates file using perl
This is what we currently do
1. read all the rows of a table and write them in a hash variable (key = primary key and value, the entire row)
This is done after validating every field and concatenating it and storing it as a value for the key)
2. We write each and every key value pair into a file and finally create the file

So, is there a way to keep writing every 1000 records at one shot so that I/O is reduced

Thanks,
Sasi
Oct 5 '07 #1
2 1376
eWish
971 Expert 512MB
Are you retrieving this data from a database and saving to a file? Can you provide a sample of the code you are using?
Oct 6 '07 #2
KevinADC
4,059 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. for (1 .. 1000) {
  2.    do something
Oct 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Dario de Judicibus | last post by:
I need to read a file as BINARY by 16 bits units, and write to another file as BINARY by 8, 16 and 24 bits units. It is pratically a pipe. I'm looking for a sample of C++ code simple, performing...
4
by: ad | last post by:
I want to send a DataSet to WebService, but the DataSet if too huge(there about 50000 records, and 50 fields every record). My solution is 1.save the DataSet as XML file, 2.zip the XML file. 3....
1
by: Nawaz Ijaz | last post by:
Hi All, Just need to know that how can it be possible to upload large file in chunks of bytes. Suppose i have a large file (100 MB) and i want to upload it in chunks (say 20 KB). How can this be...
35
by: rbt | last post by:
I've been doing some file system benchmarking. In the process, I need to create a large file to copy around to various drives. I'm creating the file like this: fd = file('large_file.bin', 'wb')...
6
by: cdecarlo | last post by:
Hello, I've often found that I am writing little scripts at the interpretor to read a text file, perform some conversion, and then write the converted data back out to a file. I normally...
16
by: Claudio Grondi | last post by:
I have a 250 Gbyte file (occupies the whole hard drive space) and want to change only eight bytes in this file at a given offset of appr. 200 Gbyte (all other data in that file should remain...
2
by: Bonzol | last post by:
vb.net 2003 Windows application We have a Client/Server system set up by communicating through a TCPClient object. The server loops continuously using a tcplistener device and each time a client...
10
by: David | last post by:
I have googled to no avail on getting specifically what I'm looking for. I have found plenty of full blown apps that implement some type of file transfer but what I'm specifcally looking for is an...
4
by: henry | last post by:
Folks: As a follow-up to my recent posts, I want to ask some more general questions about multiple instances of a CSS link in a page as seen by browsers due to server-side file inclusion. Let...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.