Sponsored Content
Top Forums Shell Programming and Scripting delete multiple lines by line number Post 302487943 by anurag.singh on Friday 14th of January 2011 07:53:25 AM
Old 01-14-2011
Yes, Bottom up is not needed. Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending line number to each line and getting total number of lines

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)
Discussion started by: chiru_h
2 Replies

2. UNIX for Dummies Questions & Answers

delete multiple lines by line number

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)
Discussion started by: ChicagoBlues
11 Replies

3. Shell Programming and Scripting

Delete lines based on line number

I have a file with ~200K lines, I need to delete 4K lines in it. There is no range. I do have the line numbers of the lines which I want to be deleted. I did tried using > cat del.lines sed '510d;12d;219d;......;3999d' file > source del.lines Word too long. I even tried... (2 Replies)
Discussion started by: novice_man
2 Replies

4. Shell Programming and Scripting

How to delete several lines from file by line number?

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)
Discussion started by: aoussenko
5 Replies

5. Shell Programming and Scripting

splitting a huge line of file into multiple lines with fixed number of columns

Hi, I have a huge file with a single line. But I want to break that line into lines of with each line having five columns. My file is like this: code: "hi","there","how","are","you?","It","was","great","working","with","you.","hope","to","work","you." I want it like this: code:... (1 Reply)
Discussion started by: rajsharma
1 Replies

6. Shell Programming and Scripting

search and replace, when found, delete multiple lines, add new set of lines?

hey guys, I tried searching but most 'search and replace' questions are related to one liners. Say I have a file to be replaced that has the following: $ cat testing.txt TESTING AAA BBB CCC DDD EEE FFF GGG HHH ENDTESTING This is the input file: (3 Replies)
Discussion started by: DeuceLee
3 Replies

7. UNIX for Dummies Questions & Answers

How to delete lines above a certin line number in bash shell

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)
Discussion started by: learninguser235
2 Replies

8. UNIX for Dummies Questions & Answers

How to delete lines above a certin line number in bash shell

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)
Discussion started by: learninguser235
5 Replies

9. Shell Programming and Scripting

Removing carriage returns from multiple lines in multiple files of different number of columns

Hello Gurus, I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file. 1|ABC DEF|100|10 2|PQ RS T|200|20 3| UVWXYZ|300|30 4| GHIJKL|400|40... (7 Replies)
Discussion started by: dJHa
7 Replies

10. UNIX for Beginners Questions & Answers

Delete multiple lines between blank lines containing two patterns

Hi all, I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex: user: alpha parameter_1 = 15 parameter_2 = 1 parameter_3 = 0 user: alpha parameter_1 = 15 parameter_2 = 1 parameter_3 = 0 user: alpha parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies
curs_border(3)						     Library Functions Manual						    curs_border(3)

NAME
curs_border, border, wborder, box, hline, whline, mvhline, mvwhline, vline, wvline, mvvline, mvwvline - Create Curses borders, and horizon- tal and vertical lines SYNOPSIS
#include <curses.h> int border( chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br ); int wborder( WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br ); int box( WINDOW *win, chtype verch, chtype horch ); int hline( chtype ch, int n ); int whline( WINDOW *win, chtype ch, int n ); int mvhline( int y, int x, chtype ch, int n ); int mvwhline( WINDOW *win, int y, int x, chtype ch, int n ); int vline( chtype ch, int n ); int wvline( WINDOW *win, chtype ch, int n ); int mvvline( int y, int x, chtype ch, int n ); int mvwvline( WINDOW *win, int y, int x, chtype ch, int n ); LIBRARY
Curses Library (libcurses) STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: border, wborder, box, hline, whline, mvhline, mvwhline, vline, wvline, mvvline, mvwvline: XCURSES4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. DESCRIPTION
The border, wborder, and box routines draw a border around the edges of the window. Each of the following arguments contains both a charac- ter and attributes for a particular part of the border: Left side Right side Top Bottom Top left-hand corner Top right-hand corner Bottom left-hand corner Bottom right-hand corner If any of these arguments is zero, then the functions use the following default values (which are defined in <curses.h>): ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE, ACS_ULCORNER, ACS_URCORNER, ACS_LLCORNER, and ACS_LRCORNER. The call box(win, verch, horch); is equivalent to the following call: wborder(win, verch, verch, horch, horch, 0, 0, 0, 0); The hline, whline, mvhline, and mvwhline functions use ch to draw a horizontal (left-to-right) line, starting at the current or specified cursor position in the current or specified window. The current cursor position is not changed. The line is at most n characters long, or as many characters as can fit into the window. The vline, wvline, mvvline, and mvwvline functions use ch to draw a vertical (top-to-bottom) line, starting at the current or specified cursor position in the current or specified window. The current cursor position is not changed. The line is at most n characters long, or as many characters as can fit into the window. NOTES
The header file <curses.h> automatically includes the header file <stdio.h>. Note that border and box may be macros. RETURN VALUES
All routines return OK on success or ERR on failure. SEE ALSO
Functions: curses(3), curs_border_set(3), curs_outopts(3) Others: standards(5) curs_border(3)
All times are GMT -4. The time now is 07:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy