473,402 Members | 2,061 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,402 software developers and data experts.

Program to split very large files by line count

I have some files that are anywhere from 3GB to 9GB and I need to split
them down to a series of smaller files similar to what the "split"
command in linux can do. Unfortunately, I do not have access to a
linux machine right now. I have been told that a program could be
written in C/C++ that would do this very quickly.

Can anyone point me to a tutorial or how-to that will teach me to write
a quick program do accomplish this?

for example

split.exe <file.to.split<output.filename.prefix>
<number.of.lines.per.file>

split.exe bigfile.txt bigfile_ 1000000

Thanks,

CJ

Nov 10 '06 #1
2 3584
Curious Joe wrote:
I have some files that are anywhere from 3GB to 9GB and I need to split
them down to a series of smaller files similar to what the "split"
command in linux can do. Unfortunately, I do not have access to a
linux machine right now. I have been told that a program could be
written in C/C++ that would do this very quickly.

Can anyone point me to a tutorial or how-to that will teach me to write
a quick program do accomplish this?

for example

split.exe <file.to.split<output.filename.prefix>
<number.of.lines.per.file>

split.exe bigfile.txt bigfile_ 1000000
Try installing mingw. It probably has the GNU splut command there.
Nov 10 '06 #2

Gianni Mariani wrote in message
<45**********************@per-qv1-newsreader-01.iinet.net.au>...
>Curious Joe wrote:
>I have some files that are anywhere from 3GB to 9GB and I need to split
them down to a series of smaller files similar to what the "split"
command in linux can do. Unfortunately, I do not have access to a
linux machine right now. I have been told that a program could be
written in C/C++ that would do this very quickly.

Can anyone point me to a tutorial or how-to that will teach me to write
a quick program do accomplish this?

for example

split.exe <file.to.split<output.filename.prefix>
<number.of.lines.per.file>

split.exe bigfile.txt bigfile_ 1000000
Try installing mingw. It probably has the GNU splut command there.
"split.exe" is in 'Msys'.

--
Bob R
POVrookie
Nov 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Brian Roberts | last post by:
I have a command line Python program that sometimes takes a bit (several minutes) to run. I want to provide an optional method for an impatient user (me!) to check the status of the program. The...
2
by: mehul | last post by:
hi all, i am just starting with PERL and had this doubt related to the speical operator +. what it says is that in the line split( / +/,$line); it will not ignore the initial spaces as it starts...
3
by: Tommo | last post by:
Hello All, I am a still learning so be easy on me. I am trying to get some code to work that is using JS and Perl/CGI, I am using AS Perl and an Apache Server on XP as the webserver. Can anyone...
11
by: James Hu | last post by:
This program is long. I don't really want to bore everyone with the details, but it handles wierd cases like: /\ * this is a comment *\ / #define FOO ??/* this is not a comment */ char...
17
by: JunDa.Huang | last post by:
I am a university student, How to study program language well ?
6
by: ivan.perak | last post by:
Hello, im a beginner in VB.NET... The thing i would like to do is as it follows.... I have a text file (list of names, every name to the next line) which is about 350000 lines long. I would...
14
by: cs | last post by:
Hi, I'm new to C and would appreciate any feedback on the following program, asplit, which splits a file into 2 new files, putting a certain number of lines in the first file, and all the rest...
10
by: len | last post by:
I have created the following program to read a text file which happens to be a cobol filed definition. The program then outputs to a file what is essentially a file which is a list definition...
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: 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
0
BarryA
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...
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
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...
0
tracyyun
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...
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.