07-19-2011
how to print out consecutive two line from a text file
the text file like below's
input:
aaaaaaaaafdsfsda
sdfsadfasdfasfds
sdfadsf
asdfadf
asdfa
adfsfsafas
sdfsfafads
asdfasdfsa
I want to print out consecutive two line
output:
aaaaaaaaafdsfsda
sdfsadfasdfasfds
sdfsfafads
asdfasdfsa
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have this text file name test.txt which contain :
aaaaa bbb
iiiiiiiiiiiii ccf
ddaaa ddd
and i need a script that can print out the line numbers using a while loop..
so when the script is run..it will have this:
1
2
3
any ideas? :) thanks guys (4 Replies)
Discussion started by: forevercalz
4 Replies
2. Shell Programming and Scripting
Hi All,
I need to print the lines after 2nd line irrespective of the number of lines in file
if the file contents are like below
----------
root:!:0:0::/root:/usr/bin/ksh
daemon:!:1:1::/etc:
bin:!:2:2::/bin:
sys:!:3:3::/usr/sys:
adm:!:4:4::/var/adm:
uucp:!:5:5::/usr/lib/uucp:... (6 Replies)
Discussion started by: ram1729
6 Replies
3. Shell Programming and Scripting
Hi,
Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11
Thanks for your help. (6 Replies)
Discussion started by: kamranjalal
6 Replies
4. Shell Programming and Scripting
I have a text file in the following format
....
START
1,1
2,1
3,1
..
..
9,1
10,1
END
....
I want to change to the output to
....
START
1,1
2,1
3,1
.. (4 Replies)
Discussion started by: VNR
4 Replies
5. Shell Programming and Scripting
Can any one help us in finding the the last word of each line from a text file and print it.
eg:
1st --> aaa bbbb cccc dddd eeee ffff ee
2nd --> aab ered er fdf ere ww ww f
the o/p should be a below.
ee
f (1 Reply)
Discussion started by: naveen_sangam
1 Replies
6. Programming
performing this code to read from file and print each character in separate line
works well with ASCII encoded text
void
preprocess_file (FILE *fp)
{
int cc;
for (;;)
{ cc = getc (fp);
if (cc == EOF)
break;
printf ("%c\n", cc);
}
}
int
main(int... (1 Reply)
Discussion started by: khaled79
1 Replies
7. Shell Programming and Scripting
I have a file lake this
cat ex1.txt
</DISCOUNTS>
<B2B_SPECIFICATION elem="0">
<B2B_SPECIFICATION elem="0">
<DESCR>Netti 2 </DESCR>
<NUMBER>D02021507505</NUMBER>
</B2B_SPECIFICATION>
<B2B_SPECIFICATION elem="1">
<DESCR>Puhepaketti</DESCR>... (2 Replies)
Discussion started by: Dhoni
2 Replies
8. Shell Programming and Scripting
Hi
I have a text file like below. THe content of the text will vary.
Entire text file have four consecutive lines followed with blank line.
I want to delete the occurrence of the two consicutive lines in the text file. I don't have pattern to match and delete. Just i need to delete all... (5 Replies)
Discussion started by: RJSKR28
5 Replies
9. Shell Programming and Scripting
Hello,
I am looking for a specific situation in a text file. The conditions are,
> <CompoundName>
InChI=1S/C5H12NO2/c1-5(2)4-8-6(3)7/h5H,4H2,1-3H3/q+1
I am looking for cases where the line "> <CompoundName>" is followed by a line that contains the string "InChI=" without regard to... (5 Replies)
Discussion started by: LMHmedchem
5 Replies
10. Shell Programming and Scripting
hi all,
trying this using shell/bash with sed/awk/grep
I have two files, one containing one column, the other containing multiple columns (comma delimited).
file1.txt
abc12345
def12345
ghi54321
...
file2.txt
abc1,text1,texta
abc,text2,textb
def123,text3,textc
gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
LEARN ABOUT DEBIAN
dlamsh
DLAMSH(l) LAPACK auxiliary routine (version 1.5) DLAMSH(l)
NAME
DLAMSH - send multiple shifts through a small (single node) matrix to see how consecutive small subdiagonal elements are modified by sub-
sequent shifts in an effort to maximize the number of bulges that can be sent through
SYNOPSIS
SUBROUTINE DLAMSH ( S, LDS, NBULGE, JBLK, H, LDH, N, ULP )
INTEGER LDS, NBULGE, JBLK, LDH, N
DOUBLE PRECISION ULP
DOUBLE PRECISION S(LDS,*), H(LDH,*)
PURPOSE
DLAMSH sends multiple shifts through a small (single node) matrix to
see how consecutive small subdiagonal elements are modified by
subsequent shifts in an effort to maximize the number of bulges
that can be sent through. DLAMSH should only be called when there are multiple shifts/bulges
(NBULGE > 1) and the first shift is starting in the middle of an
unreduced Hessenberg matrix because of two or more consecutive small
subdiagonal elements.
ARGUMENTS
S (local input/output) DOUBLE PRECISION array, (LDS,*)
On entry, the matrix of shifts. Only the 2x2 diagonal of S is referenced. It is assumed that S has JBLK double shifts (size 2).
On exit, the data is rearranged in the best order for applying.
LDS (local input) INTEGER
On entry, the leading dimension of S. Unchanged on exit. 1 < NBULGE <= JBLK <= LDS/2
NBULGE (local input/output) INTEGER
On entry, the number of bulges to send through H ( >1 ). NBULGE should be less than the maximum determined (JBLK). 1 < NBULGE <=
JBLK <= LDS/2 On exit, the maximum number of bulges that can be sent through.
JBLK (local input) INTEGER
On entry, the number of shifts determined for S. Unchanged on exit.
H (local input/output) DOUBLE PRECISION array (LDH,N)
On entry, the local matrix to apply the shifts on. H should be aligned so that the starting row is 2. On exit, the data is
destroyed.
LDS (local input) INTEGER
On entry, the leading dimension of S. Unchanged on exit.
N (local input) INTEGER
On entry, the size of H. If all the bulges are expected to go through, N should be at least 4*NBULGE+2. Otherwise, NBULGE may be
reduced by this routine.
ULP (local input) DOUBLE PRECISION
On entry, machine precision Unchanged on exit.
Implemented by: G. Henry, May 1, 1997
LAPACK version 1.5 12 May 1997 DLAMSH(l)