Sponsored Content
Top Forums Shell Programming and Scripting Select columns from a matrix given within a range in BASH Post 302520522 by cfajohnson on Saturday 7th of May 2011 10:32:58 PM
Old 05-07-2011

That's what cut is meant for:
Code:
cut -d ' ' -f 1-2000 "$file" > "$newfile"

This User Gave Thanks to cfajohnson For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

convert matrix to row and columns

Dear Unix Gurus, I have a sample data set that looks like this y1 y2 y3 y4 y5 x1 0.3 0.5 2.3 3.1 5.1 x2 1.2 4.1 3.5 1.7 1.2 x3 3.1 2.1 1.0 4.1 2.1 x4 5.0 4.0 6.0 7.0 1.1 I want to open it up so that I get x1 y1 0.3 x2 y1 1.2 x3 y1 3.1 x4 y1 5.0 x1 y2 0.5 x2 y2... (3 Replies)
Discussion started by: tintin72
3 Replies

2. UNIX for Dummies Questions & Answers

select nth file & range of files

Two related questions; 1. how do i select the nth file in a directory? 2. how do i select a range of files, say 2nd-5th? I have done the following but I don't think the solution is a neat one. Query 1: select nth file - say 3rd file; #!/bin/bash touch foo1 foo2 foo3 foo4 foo5 foo6... (1 Reply)
Discussion started by: Muhammad Rahiz
1 Replies

3. Shell Programming and Scripting

Adding the individual columns of a matrix.

I have a huge matrix file containing some 1.5 million rows and 6000 columns. The matrix looks something like this: 1 2 3 4 5 6 7 8 9 3 4 5 I want to add all the numbers in the columns of this matrix and display the result to my stdout. This means that the numbers in the first column are: ... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

4. Emergency UNIX and Linux Support

show div on select - range of dates

Hi, I am sure this is simple, but I am breaking my head. I need 1 page with at the top a range of dates, 2002, 2003, 2004 etc If you select 2002 it will show the content of 1 div, if you select 2002 the content of another div. this is for showing announcements on a site, right now there... (1 Reply)
Discussion started by: lawstudent
1 Replies

5. Shell Programming and Scripting

conversion: 3 columns into matrix

Hi guys, here https://www.unix.com/shell-programming-scripting/193043-3-column-csv-correlation-matrix-awk-perl.html I found awk script converting awk '{ OFS = ";" if (t) { if (l != $1) t = t OFS $1 } else t = OFS $1 x = x ? x OFS $NF : $NF l = $1 }... (2 Replies)
Discussion started by: grincz
2 Replies

6. Programming

Converting columns to matrix

Dear All I would like to convert columns to matrix For example my data looks like this D2 0 D2 0 1.0 D2 0 D2 1 0.308 D2 0 D2 2 0.554 D2 0 D2 3 0.287 D2 0 D2 4 0.633 D2 0 D2 5 0.341 D2 0 D2 6 0.665 D2 0 D2 7 0.698 D2 0 D2 8 0.625 D2 0 D2 9 0.429 D2 0 D2 10 0.698 D2 0 D2 11... (7 Replies)
Discussion started by: bala06
7 Replies

7. Shell Programming and Scripting

Square matrix to columns

Hello all, I am quite new in this but I need some help to keep going with my analysis. I am struggling with a short script to read a square matrix and convert it in two collumns. A B C D A 0.00 0.06 0.51 0.03 B 0.06 0.00 0.72 0.48 C 0.51 0.72 0.00 ... (7 Replies)
Discussion started by: EvaAM
7 Replies

8. Shell Programming and Scripting

Sum of range of rows and columns in matrix

Hi all, I have a large matrix of 720 x 25. I want to get sum of range of rows and columns. Like, I need sum of all columns and row number 2 to 21, then leaving 22nd row, again sum of all columns and row number 23 to 42 again leaving 43rd row and then sum of 44th to 63. Means I want to add all... (4 Replies)
Discussion started by: CAch
4 Replies

9. Shell Programming and Scripting

How to convert 2 columns into matrix -awk?

How can i convert two columns in to o and 1 matrix. thnks Input a c1 b c2 c c1 d c3 e c4 output c1 c2 c3 c4 a 1 0 0 0 b 0 1 0 0 c 1 0 0 0 d 0 0 ... (5 Replies)
Discussion started by: quincyjones
5 Replies

10. Shell Programming and Scripting

Transform columns to matrix

The following code transform the matrix to columns. Is it possible to do it other way around ( get the input from the output) ? input y1 y2 y3 y4 y5 x1 0.3 0.5 2.3 3.1 5.1 x2 1.2 4.1 3.5 1.7 1.2 x3 3.1 2.1 1.0 4.1 2.1 x4 5.0 4.0 6.0 7.0 1.1 output x1 y1 0.3 x2 y1 1.2 x3... (1 Reply)
Discussion started by: quincyjones
1 Replies
zlag2c.f(3)							      LAPACK							       zlag2c.f(3)

NAME
zlag2c.f - SYNOPSIS
Functions/Subroutines subroutine zlag2c (M, N, A, LDA, SA, LDSA, INFO) ZLAG2C converts a complex double precision matrix to a complex single precision matrix. Function/Subroutine Documentation subroutine zlag2c (integerM, integerN, complex*16, dimension( lda, * )A, integerLDA, complex, dimension( ldsa, * )SA, integerLDSA, integerINFO) ZLAG2C converts a complex double precision matrix to a complex single precision matrix. Purpose: ZLAG2C converts a COMPLEX*16 matrix, SA, to a COMPLEX matrix, A. RMAX is the overflow for the SINGLE PRECISION arithmetic ZLAG2C checks that all the entries of A are between -RMAX and RMAX. If not the convertion is aborted and a flag is raised. This is an auxiliary routine so there is no argument checking. Parameters: M M is INTEGER The number of lines of the matrix A. M >= 0. N N is INTEGER The number of columns of the matrix A. N >= 0. A A is COMPLEX*16 array, dimension (LDA,N) On entry, the M-by-N coefficient matrix A. LDA LDA is INTEGER The leading dimension of the array A. LDA >= max(1,M). SA SA is COMPLEX array, dimension (LDSA,N) On exit, if INFO=0, the M-by-N coefficient matrix SA; if INFO>0, the content of SA is unspecified. LDSA LDSA is INTEGER The leading dimension of the array SA. LDSA >= max(1,M). INFO INFO is INTEGER = 0: successful exit. = 1: an entry of the matrix A is greater than the SINGLE PRECISION overflow threshold, in this case, the content of SA in exit is unspecified. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: September 2012 Definition at line 108 of file zlag2c.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.2 Tue Sep 25 2012 zlag2c.f(3)
All times are GMT -4. The time now is 09:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy