Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me.
I have a file say:
abc
def
ccc
ddd
ffff
The output should be:
Instance1=abc
Instance2=def
Instance3=ccc
Instance4=ddd
Instance5=ffff
... (2 Replies)
I have been googling, but cannot find that works for me.
I have a text file tmp.out with contents:
sadfsdf sdfosuidhfousdhof soduhf osdfu osudfhosudhfd
sdfgsdfg
asdfiojhsdf asdoludhflsdjfhskldjfhsdjdlfsjdhnlj h sdja
ouahsdjdafkljsa
oljhljh
I have another file... (11 Replies)
I have file with 10000 records and i need to delete the lines in single shot based on line number range say from 10 to 51 , 53 to 59 , 105 to 107, 311 to 592 etc... between range works fine for me but how to achive for above case? please help
sed '10,51 {d}' infile > outfile (5 Replies)
This is a variation of an earlier post found here:
unixcom/shell-programming-scripting/159821-merge-two-non-consecutive-lines.html
User Bartus11 was kind enough to solve that example.
Previously, I needed help combining two lines that are non-consecutive in a file. Now I need to do the... (7 Replies)
I have a file that contains 87 lines, each with a set of coordinates (x & y). This file looks like:
1 200.3 -0.3
2 201.7 -0.32
...
87 200.2 -0.314
I have another file which contains data that was taken at certain of these 87 positions. i.e.:
37 125
42 175
86 142
where the first... (1 Reply)
Hi
I am using the following command to delete a line from the file by line number:
line_number=14
sed "${line_number}d" inputfilename > newfilename
Is there a way to modify this command to specify the range of lines to be deleted, lets say from line 14 till line 5 ?
I tried using the... (5 Replies)
Hi,
I have written a script that returns the line number of the pattern i want and i stored the line number in a variable(getlinenumber).Now i want to delete all the lines in a file above this line number which is stored in a variable.
i am using sed '1,$getlinenumberd' > file1.txt which is... (2 Replies)
Hi,
I have written a script that returns the line number of the pattern i want and i stored the line number in a variable.Now i want to delete all the lines in a file above this line number which is stored in a variable.
i am using sed '1,$getlinenumberd' > file1.txt which is not working(wrog... (5 Replies)
hi Gurus,
I need separate a file which is one huge line to multiple lines based on certain number of charactors. for example:
abcdefghi high abaddffdd
I want to separate the line to multiple lines for every 4 charactors.
the result should be
abcd
efgh
i hi
gh a
badd
ffdd
Thanks in... (5 Replies)
Hi,
I have a file like below.
1,2,3,4,5,6,7,8,9I would like to print or copied to a file based of line count in perl
If I gave a condition 1 to 3 then it should iterate over above file and print 1 to 3 and then again 1 to 3 etc.
output should be
1,2,3
4,5,6
7,8,9 (10 Replies)
Discussion started by: Anjan1
10 Replies
LEARN ABOUT OPENSOLARIS
curs_scroll
curs_scroll(3CURSES) Curses Library Functions curs_scroll(3CURSES)NAME
curs_scroll, scroll, scrl, wscrl - scroll a curses window
SYNOPSIS
cc [ flag ... ] file ... -lcurses [ library ... ]
#include <curses.h>
int scroll(WINDOW *win);
int scrl(int n);
int wscrl(WINDOW *win, int n);
DESCRIPTION
With the scroll() routine, the window is scrolled up one line. This involves moving the lines in the window data structure. As an optimiza-
tion, if the scrolling region of the window is the entire screen, the physical screen is scrolled at the same time.
With the scrl() and wscrl() routines, for positive n scroll the window up n lines (line i+n becomes i); otherwise scroll the window down n
lines. This involves moving the lines in the window character image structure. The current cursor position is not changed.
For these functions to work, scrolling must be enabled via scrollok().
RETURN VALUES
All routines return the integer ERR upon failure and an integer value other than ERR upon successful completion.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO curs_outopts(3CURSES), curses(3CURSES), attributes(5)NOTES
The header <curses.h> automatically includes the headers <stdio.h> and <unctrl.h>.
Note that scrl() and scroll() may be macros.
SunOS 5.11 31 Dec 1996 curs_scroll(3CURSES)