12-02-2015
Dynamically split file
Hi guys,
I have a file with 10000 entries (there are 2 columns. the first column contains the the product name and the second column contains the quantity of each product).
I would like to split this file into 5 different files. I want the 1st entry to go to the fileA the 2nd entry to fileB the 3rd entry to fileC the 4th entry to fileD and the 5th entry to fileE.
Then the 6th entry (and the rest of the entries) I would like to be added to the file with the lowest product quantity.
So somehow I want to check the files (based on the current quantity) before a new entry will be added.
Is there any way to do that in unix shell?
Thank you in advance.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi friends ,
how do i view a dynamically linked file in unix ?
its there on other system and do i have to ftp it in ASCII format or binary ?
and after the ftp how do i view it ?
thanks in advance
veeras (1 Reply)
Discussion started by: sveera
1 Replies
2. UNIX for Advanced & Expert Users
Hi friends,
i have a dynamically linked file on my solaris system.this is script that runs regularly. How can i read the contents of that ?
when i tried to say "vi filename " then it says executable and nothing is seen.
Please help.
thanks in advance
Veera (5 Replies)
Discussion started by: sveera
5 Replies
3. Shell Programming and Scripting
Hi,
I was wandering would it be possible to split the record dynamically based on the certain values, for an instance
i have a file with record with predefined split value i.e 10
col1 col2 col3 col4
------------------------
aaaa bbbb 2 44aaaabbbb55cccddd1110
mmn xnmn 3... (6 Replies)
Discussion started by: braindrain
6 Replies
4. UNIX for Dummies Questions & Answers
I have gone through all the threads in the forum and tested out different things. I am trying to split a 3GB file into multiple files. Some files are even larger than this.
For example:
split -l 3000000 filename.txt
This is very slow and it splits the file with 3 million records in each... (10 Replies)
Discussion started by: madhunk
10 Replies
5. Shell Programming and Scripting
i am creating the file , when this file reaches the size 2 GB, i need one message or fire (4 Replies)
Discussion started by: kingganesh04
4 Replies
6. Shell Programming and Scripting
Hi,
I have a requriement where in I need to install a s/w by executing the installable file through a script. The script currently contains the path of the installable file. I need to now update the script accordingly such tht it identifies the location of the installable file automatically and... (1 Reply)
Discussion started by: yoursdavinder
1 Replies
7. UNIX for Dummies Questions & Answers
Hi
my requriment is read the file name dynamically my code is
#!/bin/sh
file="/c/work/loan/"
Header_Trailer_move()
{
sed '1d;$d' $file| cat >sam.txt
}
Header_Trailer_move
in above given path my list of files or there i have to read file dyanamically when i entered particular file name... (2 Replies)
Discussion started by: sgoud
2 Replies
8. Shell Programming and Scripting
Hi Guru's,
I am new to shell scripting. I have a unique requirement:
The system generates a single pdf(/tmp/ABC.pdf) file with Invoices for Multiple Customers, the format is something like this:
Page1 >> Customer 1 >>Invoice1 + invoice 2 >> Page1 end
Page2 >> Customer 2 >>Invoice 3 + Invoice 4... (3 Replies)
Discussion started by: DIps
3 Replies
9. Shell Programming and Scripting
Not sure how to do the following, but any help would be appreciated.
Has to be done using C shell (sorry about that).
I have about 300 files that I need this done for, but I am only going to give one example. I will just need to know how to execute your solution through some type of loop to get... (2 Replies)
Discussion started by: jclanc8
2 Replies
10. Shell Programming and Scripting
Hello ,
I have a flat file ( comma separated ) and want to split dynamically .
If I provide input 3 then rows 1,4,7 will o/p to a file and rows 2,5,8 will redirect to 2nd file and 3,6,9 rows will go to 3rd file
So 3 files will be generated .
Could it be possible in Unix? (2 Replies)
Discussion started by: Pratik4891
2 Replies
cspmv.f(3) LAPACK cspmv.f(3)
NAME
cspmv.f -
SYNOPSIS
Functions/Subroutines
subroutine cspmv (UPLO, N, ALPHA, AP, X, INCX, BETA, Y, INCY)
CSPMV computes a matrix-vector product for complex vectors using a complex symmetric packed matrix
Function/Subroutine Documentation
subroutine cspmv (characterUPLO, integerN, complexALPHA, complex, dimension( * )AP, complex, dimension( * )X, integerINCX, complexBETA,
complex, dimension( * )Y, integerINCY)
CSPMV computes a matrix-vector product for complex vectors using a complex symmetric packed matrix
Purpose:
CSPMV performs the matrix-vector operation
y := alpha*A*x + beta*y,
where alpha and beta are scalars, x and y are n element vectors and
A is an n by n symmetric matrix, supplied in packed form.
Parameters:
UPLO
UPLO is CHARACTER*1
On entry, UPLO specifies whether the upper or lower
triangular part of the matrix A is supplied in the packed
array AP as follows:
UPLO = 'U' or 'u' The upper triangular part of A is
supplied in AP.
UPLO = 'L' or 'l' The lower triangular part of A is
supplied in AP.
Unchanged on exit.
N
N is INTEGER
On entry, N specifies the order of the matrix A.
N must be at least zero.
Unchanged on exit.
ALPHA
ALPHA is COMPLEX
On entry, ALPHA specifies the scalar alpha.
Unchanged on exit.
AP
AP is COMPLEX array, dimension at least
( ( N*( N + 1 ) )/2 ).
Before entry, with UPLO = 'U' or 'u', the array AP must
contain the upper triangular part of the symmetric matrix
packed sequentially, column by column, so that AP( 1 )
contains a( 1, 1 ), AP( 2 ) and AP( 3 ) contain a( 1, 2 )
and a( 2, 2 ) respectively, and so on.
Before entry, with UPLO = 'L' or 'l', the array AP must
contain the lower triangular part of the symmetric matrix
packed sequentially, column by column, so that AP( 1 )
contains a( 1, 1 ), AP( 2 ) and AP( 3 ) contain a( 2, 1 )
and a( 3, 1 ) respectively, and so on.
Unchanged on exit.
X
X is COMPLEX array, dimension at least
( 1 + ( N - 1 )*abs( INCX ) ).
Before entry, the incremented array X must contain the N-
element vector x.
Unchanged on exit.
INCX
INCX is INTEGER
On entry, INCX specifies the increment for the elements of
X. INCX must not be zero.
Unchanged on exit.
BETA
BETA is COMPLEX
On entry, BETA specifies the scalar beta. When BETA is
supplied as zero then Y need not be set on input.
Unchanged on exit.
Y
Y is COMPLEX array, dimension at least
( 1 + ( N - 1 )*abs( INCY ) ).
Before entry, the incremented array Y must contain the n
element vector y. On exit, Y is overwritten by the updated
vector y.
INCY
INCY is INTEGER
On entry, INCY specifies the increment for the elements of
Y. INCY must not be zero.
Unchanged on exit.
Author:
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date:
September 2012
Definition at line 152 of file cspmv.f.
Author
Generated automatically by Doxygen for LAPACK from the source code.
Version 3.4.2 Tue Sep 25 2012 cspmv.f(3)