Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to split a huge file into small pieces (per 2000 columns)? Post 302560305 by forevertl on Thursday 29th of September 2011 11:52:54 AM
Old 09-29-2011
How to split a huge file into small pieces (per 2000 columns)?

Dear all,

I have a big file:2879(rows)x400,170 (columns) like below. I 'd like to split the file into small pieces:2879(rows)x2000(columns) per file (the last small piece will be 2879x170.
So far, I only know how to create one samll piece at one time. But actually I need to repeat this work many times. I am wondering if there is a easy way I just run the code once and it will create all the samll pieces itself. Anyone can help? Thanks!!

file:
Code:
1 0 0.898 0.123 1 0 1 0 0.7987 0.124 1 0 ...
0.123 1 0 1 0 0.7987 0.124 1 0 1 0 1 0...
...

Thanks.
Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!

Last edited by vgersh99; 09-29-2011 at 12:57 PM.. Reason: code tags, please!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split a file into 16 small files

Hi I want to split a file that has 'n' number of records into 16 small files. Can some one suggest me how to do this using Unix script? Thanks rrkk (10 Replies)
Discussion started by: rrkks
10 Replies

2. Shell Programming and Scripting

How do I split file into pieces with PERL?

How do I split file into pieces with PERL? IE file.txt head 1 2 3 4 end head 5 6 7 8 9 end n so on (7 Replies)
Discussion started by: 3junior
7 Replies

3. Shell Programming and Scripting

Help- counting delimiter in a huge file and split data into 2 files

I’m new to Linux script and not sure how to filter out bad records from huge flat files (over 1.3GB each). The delimiter is a semi colon “;” Here is the sample of 5 lines in the file: Name1;phone1;address1;city1;state1;zipcode1 Name2;phone2;address2;city2;state2;zipcode2;comment... (7 Replies)
Discussion started by: lv99
7 Replies

4. Shell Programming and Scripting

how to split a huge file by every 100 lines

into small files. i need to add a head.txt and tail.txt into small files at the begin and end, and give a name as q1.xml q2.xml q3.xml .... thank you very much. (2 Replies)
Discussion started by: dtdt
2 Replies

5. Shell Programming and Scripting

Split a 30GB XML file into 16 pieces

I have a 30 GB XMl file which looks like this: <page> <title>APRIL</title> .........(text contents that I need to extract and store in 1.dat including the <title> tag) </page> <page> <title>August</title> ....(text contents that I need to store in 2.dat including the <title> tag) </page>... (13 Replies)
Discussion started by: shoaibjameel123
13 Replies

6. Solaris

How to split 10GB file into small Sizes

Hi Team I have one 10 Gb log file I want to split it into say 10 of 1-1Gb file pls share ur experiences how to do this? Thanks in advance, (3 Replies)
Discussion started by: zimmyyash
3 Replies

7. UNIX for Dummies Questions & Answers

Split a huge 7 GB File Based on Pattern into 4 files

Hi, I have a Huge 7 GB file which has around 1 million records, i want to split this file into 4 files to contain around 250k messages each. Please help me as Split command cannot work here as it might miss tags.. Format of the file is as below <!--###### ###### START-->... (6 Replies)
Discussion started by: KishM
6 Replies

8. Shell Programming and Scripting

How to split this txt file into small files?

Dear shell experts, I would like to spilt a txt file into small ones. However, I did not know how to program use shell. If someone could help, it is greatly appreciated! Specifically, I supposed there is file named A.txt. The content of the file likes this: Subject run condtion ACC time... (3 Replies)
Discussion started by: psychmyluo
3 Replies

9. UNIX for Beginners Questions & Answers

Split large file into 24 small files on one hour basis

I Have a large file with 24hrs log in the below format.i need to split the large file in to 24 small files on one hour based.i.e ex:from 09:55 to 10:55,10:55-11:55 can any one help me on this.! ... (20 Replies)
Discussion started by: Raghuram717
20 Replies

10. Solaris

Split huge File System

Gents I have huge NAS File System as /sys with size 10 TB and I want to Split each 1TB in spirit File System to be mounted in the server. How to can I do that without changing anything in the source. Please your support. (1 Reply)
Discussion started by: AbuAliiiiiiiiii
1 Replies
DLARRE(l)								 )								 DLARRE(l)

NAME
DLARRE - the tridiagonal matrix T, DLARRE sets "small" off-diagonal elements to zero, and for each unreduced block T_i, it finds (i) the numbers sigma_i (ii) the base T_i - sigma_i I = L_i D_i L_i^T representations and (iii) eigenvalues of each L_i D_i L_i^T SYNOPSIS
SUBROUTINE DLARRE( N, D, E, TOL, NSPLIT, ISPLIT, M, W, WOFF, GERSCH, WORK, INFO ) INTEGER INFO, M, N, NSPLIT DOUBLE PRECISION TOL INTEGER ISPLIT( * ) DOUBLE PRECISION D( * ), E( * ), GERSCH( * ), W( * ), WOFF( * ), WORK( * ) PURPOSE
Given the tridiagonal matrix T, DLARRE sets "small" off-diagonal elements to zero, and for each unreduced block T_i, it finds (i) the num- bers sigma_i (ii) the base T_i - sigma_i I = L_i D_i L_i^T representations and (iii) eigenvalues of each L_i D_i L_i^T. The representations and eigenvalues found are then used by DSTEGR to compute the eigenvectors of a symmetric tridiagonal matrix. Currently, the base represen- tations are limited to being positive or negative definite, and the eigenvalues of the definite matrices are found by the dqds algorithm (subroutine DLASQ2). As an added benefit, DLARRE also outputs the n Gerschgorin intervals for each L_i D_i L_i^T. ARGUMENTS
N (input) INTEGER The order of the matrix. D (input/output) DOUBLE PRECISION array, dimension (N) On entry, the n diagonal elements of the tridiagonal matrix T. On exit, the n diagonal elements of the diagonal matrices D_i. E (input/output) DOUBLE PRECISION array, dimension (N) On entry, the (n-1) subdiagonal elements of the tridiagonal matrix T; E(N) need not be set. On exit, the subdiagonal elements of the unit bidiagonal matrices L_i. TOL (input) DOUBLE PRECISION The threshold for splitting. If on input |E(i)| < TOL, then the matrix T is split into smaller blocks. NSPLIT (input) INTEGER The number of blocks T splits into. 1 <= NSPLIT <= N. ISPLIT (output) INTEGER array, dimension (2*N) The splitting points, at which T breaks up into submatrices. The first submatrix consists of rows/columns 1 to ISPLIT(1), the sec- ond of rows/columns ISPLIT(1)+1 through ISPLIT(2), etc., and the NSPLIT-th consists of rows/columns ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N. M (output) INTEGER The total number of eigenvalues (of all the L_i D_i L_i^T) found. W (output) DOUBLE PRECISION array, dimension (N) The first M elements contain the eigenvalues. The eigenvalues of each of the blocks, L_i D_i L_i^T, are sorted in ascending order. WOFF (output) DOUBLE PRECISION array, dimension (N) The NSPLIT base points sigma_i. GERSCH (output) DOUBLE PRECISION array, dimension (2*N) The n Gerschgorin intervals. WORK (input) DOUBLE PRECISION array, dimension (4*N???) Workspace. INFO (output) INTEGER Output error code from DLASQ2 FURTHER DETAILS
Based on contributions by Inderjit Dhillon, IBM Almaden, USA Osni Marques, LBNL/NERSC, USA LAPACK version 3.0 15 June 2000 DLARRE(l)
All times are GMT -4. The time now is 07:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy