Sponsored Content
Full Discussion: Swapping three lines
Top Forums Shell Programming and Scripting Swapping three lines Post 302454813 by dsjkvf on Monday 20th of September 2010 04:35:03 AM
Old 09-20-2010
thanks! but now it only changes the first array of data, operates with the first three lines (and I have a lot of all those <date></date><text></text><name></name>).

so, I wonder, how to make it to operate with the whole input, is there some kind of global switch?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Swapping questions

How can you tell how much a Solaris box is swapping? At what point do page in and page out become a problem? Here is a vmstat output. > vmstat procs memory page disk faults cpu r b w swap free re mf pi po fr de sr m0 m1 m2 m3 in sy cs us sy id... (1 Reply)
Discussion started by: 98_1LE
1 Replies

2. SuSE

Swapping

Hello! Why does my SuSE GNU/Linux machine swap? I have a Gig of ram, currently 14MBs of free RAM, 724MB - buffers and caches... That is 685MB of cached RAM, then kernel really should'nt have to swap, It should release cached memory in my thinkin... It has only swaped 3MB's but still,... (3 Replies)
Discussion started by: Esaia
3 Replies

3. Shell Programming and Scripting

Swapping or switching 2 lines using sed

I made a script that can swap info on two lines using a combination of awk and sed, but was hoping to consolidate the script to make it run faster. If found this script, but can't seem to get it to work in a bash shell. I keep getting the error "Too many {'s". Any help here would be appreciated:... (38 Replies)
Discussion started by: LaTortuga
38 Replies

4. Shell Programming and Scripting

Swapping lines beginning with certain words using sed/awk

I have a large file which reads like this: fixed-address 192.168.6.6 { hardware ethernet 00:22:64:5b:db:b1; host X; } fixed-address 192.168.6.7 { hardware ethernet 00:22:64:5b:db:b3; host Y; } fixed-address 192.168.6.8 { hardware ethernet 00:22:64:5b:db:b4; host A; }... (4 Replies)
Discussion started by: ksk
4 Replies

5. Shell Programming and Scripting

swapping lines that match a condition using sed, perl or the like

I'm a bit new to regex and sed/perl stuff, so I would like to ask for some advice. I have tried several variations of scripts I've found on the net, but can't seem to get them to work out just right. I have a file with the following information... # Host 1 host 45583 { filename... (4 Replies)
Discussion started by: TheBigAmbulance
4 Replies

6. Shell Programming and Scripting

AWK swapping fields on different lines

Hi All, Sorry if this question has been posted elsewhere, but I'm hoping someone can help me! Bit of an AWK newbie here, but I'm learning (slowly!) I'm trying to cobble a script together that will save me time (is there any other kind?), to swap two fields (one containing whitespace), with... (5 Replies)
Discussion started by: Bravestarr
5 Replies

7. Shell Programming and Scripting

Swapping fields

Hallo Team, This is the command that i am running : grep ",Call Forward Not Reachable" *2013* this is the output that i am getting (i did a head -10 but the files can be more than 1000) ... (8 Replies)
Discussion started by: kekanap
8 Replies

8. Shell Programming and Scripting

Swapping the 1st 4 lines only

How can you swap the first 4 line only, the rest will stay the same. thanks #!/bin/sh line=4 awk -v var="$line" 'NR==var { s=$0 getline;s=$0"\n"s getline;print;print s next }1' fileko.tx . desired output: (8 Replies)
Discussion started by: invinzin21
8 Replies

9. Solaris

Swapping

Hi Guys I am using SPARC-T4 (chipid 0, clock 2998 MHz), SunOS 5.10 Generic_150400-38 sun4v. How do I see if the server was doing some swapping like yesterday? I had a java application error with java.lang.OutOfMemoryError, now I want to check if the server was not doing some swapping at... (4 Replies)
Discussion started by: Phuti
4 Replies

10. Shell Programming and Scripting

Swapping lines

Hi there, I have a text that I'm trying to format into something more readable. However, I'm stuck in the last step. I've searched and tried things over the internet with no avail. OS: Mac After parsing the original text that I won't put here, I managed to get something like this, but this... (8 Replies)
Discussion started by: Kibou
8 Replies
PDRSCL(l)					      LAPACK auxiliary routine (version 1.5)						 PDRSCL(l)

NAME
PDRSCL - multiplie an N-element real distributed vector sub( X ) by the real scalar 1/a SYNOPSIS
SUBROUTINE PDRSCL( N, SA, SX, IX, JX, DESCX, INCX ) INTEGER IX, INCX, JX, N DOUBLE PRECISION SA INTEGER DESCX( * ) DOUBLE PRECISION SX( * ) PURPOSE
PDRSCL multiplies an N-element real distributed vector sub( X ) by the real scalar 1/a. This is done without overflow or underflow as long as the final result sub( X )/a does not overflow or underflow. where sub( X ) denotes X(IX:IX+N-1,JX:JX), if INCX = 1, X(IX:IX,JX:JX+N-1), if INCX = M_X. Notes ===== Each global data object is described by an associated description vector. This vector stores the information required to establish the mapping between an object element and its corresponding process and memory location. Let A be a generic term for any 2D block cyclicly distributed array. Such a global array has an associated description vector descA. In the following comments, the character _ should be read as "of the global array". NOTATION STORED IN EXPLANATION --------------- -------------- -------------------------------------- DT_A (global) descA[ DT_ ] The descriptor type. In this case, DT_A = 1. CTXT_A (global) descA[ CTXT_ ] The BLACS context handle, indicating the BLACS process grid A is distribu- ted over. The context itself is glo- bal, but the handle (the integer value) may vary. M_A (global) descA[ M_ ] The number of rows in the global array A. N_A (global) descA[ N_ ] The number of columns in the global array A. MB_A (global) descA[ MB_ ] The blocking factor used to distribu- te the rows of the array. NB_A (global) descA[ NB_ ] The blocking factor used to distribu- te the columns of the array. RSRC_A (global) descA[ RSRC_ ] The process row over which the first row of the array A is distributed. CSRC_A (global) descA[ CSRC_ ] The process column over which the first column of the array A is distributed. LLD_A (local) descA[ LLD_ ] The leading dimension of the local array. LLD_A >= MAX(1,LOCr(M_A)). Let K be the number of rows or columns of a distributed matrix, and assume that its process grid has dimension p x q. LOCr( K ) denotes the number of elements of K that a process would receive if K were distributed over the p processes of its process col- umn. Similarly, LOCc( K ) denotes the number of elements of K that a process would receive if K were distributed over the q processes of its process row. The values of LOCr() and LOCc() may be determined via a call to the ScaLAPACK tool function, NUMROC: LOCr( M ) = NUMROC( M, MB_A, MYROW, RSRC_A, NPROW ), LOCc( N ) = NUMROC( N, NB_A, MYCOL, CSRC_A, NPCOL ). An upper bound for these quantities may be computed by: LOCr( M ) <= ceil( ceil(M/MB_A)/NPROW )*MB_A LOCc( N ) <= ceil( ceil(N/NB_A)/NPCOL )*NB_A Because vectors may be seen as particular matrices, a distributed vector is considered to be a distributed matrix. ARGUMENTS
N (global input) pointer to INTEGER The number of components of the distributed vector sub( X ). N >= 0. SA (global input) DOUBLE PRECISION The scalar a which is used to divide each component of sub( X ). SA must be >= 0, or the subroutine will divide by zero. SX (local input/local output) DOUBLE PRECISION array containing the local pieces of a distributed matrix of dimension of at least ( (JX-1)*M_X + IX + ( N - 1 )*abs( INCX ) ) This array contains the entries of the distributed vector sub( X ). IX (global input) pointer to INTEGER The global row index of the submatrix of the distributed matrix X to operate on. JX (global input) pointer to INTEGER The global column index of the submatrix of the distributed matrix X to operate on. DESCX (global and local input) INTEGER array of dimension 8. The array descriptor of the distributed matrix X. INCX (global input) pointer to INTEGER The global increment for the elements of X. Only two values of INCX are supported in this version, namely 1 and M_X. LAPACK version 1.5 12 May 1997 PDRSCL(l)
All times are GMT -4. The time now is 09:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy