Split files using Csplit

I have an excel file with more than 65K records... Since excel does not take more than 65K records i wan to split the file and send it as two excel files... Could some help me how to use the csplit by specifiying the no of records

What format is the file in?

it saved with .xls as the extension
Basically i want to know howwe can split the file at every 65K records.. or just say if i have a file with 40 records i want to make it into 4 files with 10 records each

Is it in XLS format though?

How did you create the file if it exceeds Excel limits?

it gets created from a stored proc .. gets saved in unix directory .xls.. which needs to ftp to winndows server

If you can just help me how to split a file irrespective of format... I think i can manage

This link shows how to split/recombine any file, into whatever size you want:
fsplit -- splitting up a binary file

However, an excel file would need to be recombined to work correctly, as its formatted in such a way, i.e, a binary file.you can't just cut it up and use the pieces.
I've used this to split >2G binary files, to put on fileservers that are not largefile aware, then they get copied to thier destination, recombined, and
everything works just fine.

The real fix for your delima will be in changing the program thats creating your "to large" excel file, to having a limit of ( 64k - some safety factor ), and putting the remainder into another file. Programs/scripts that create any sort of data, files, etc really need to be aware of the limitation of whatever will be using output it creates.

I bet (but I might be wrong) your 'stored proc' creates a file in CSV format and names it with the '.xls' extention. Just do a more/less on the file to see what's inside first.
If it's a real Excel xls binary file... splitting it into smaller piece might an issue. As denn has suggested above a really solution would be make your 'stored proc' largefile 'aware' creating smaller files.

Hi.

If your Excel file is in native format, another possibility is to look at:
binp/xls2tsv - filter Excel worksheets into tab-separated text at Steve Kinzler - Home Directory -- then using a split or csplit to slice up your file.

It may require that a few perl modules from CPAN are available on your system, so if you are not comfortable installing those, then this is not a useful idea.

If your problem is a transfer limitation (e.g. some limit of the ftp server with which you are working), then standard split will split at a specific number of bytes. A brief look at fsplit suggests that it will work as well, and is described as working with a binary file, which I interpret as any file, because it uses dd, and dd is does not look at line structures. (Do not confuse that fsplit with a similarly-named fsplit which parses Fortran modules.)

Best wishes ... cheers, drl