09-11-2013
Quote:
Originally Posted by
mohit kanoongo
Great it worked.
But somehow the top most line was not included by this command. Any reasons why.
For ex:
Topmost is Header line
Second was the body line but it remains there even if at 356 character it is "1" instead of "W"
Can you please help
In your 1st message in this thread, you said:
Quote:
There are two lines as one Header and one trailer which should remain same.
rdrtx1 and I both understood this to mean that there were two header ilnes and one trailer line. If there is just one header line, change
NR<3; in rdtx1's script to
NR<2; or
NR==1;.
If you are trying this on a Solaris/SunOS system, use
/usr/xpg4/bin/awk,
/usr/xpg6/bin/awk, on
nawk instead of
awk.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file which has some lines starting with a particular word. I would like to delete 5 lines before each such line containing that particular word.
eg:
line1
line2
line3
line4
line5
line6
"particular word"...
I would like to delete line2-line6 and all such occurences in that... (4 Replies)
Discussion started by: ramu_1980
4 Replies
2. Shell Programming and Scripting
Hi There
I have this file that I would like to add entries to, however, there is a "}" as the last line that I need to keep. Basically i would like to know how I can write a script that will add new lines at the second to last line position (ie always add new line above the close bracket)
... (17 Replies)
Discussion started by: hcclnoodles
17 Replies
3. Shell Programming and Scripting
Hi,
I need to insert two new lines in a file:
The file:
".....
......
ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`"
....
....
"
I need to add the lines:
LD_LIBRARY_PATH='$LD_LIBRARY_PATH:$APACHE_HOME/modules'
DOWNLOADMODULE_CONF_PATHNAME='$APACHE_HOME/conf/DWLModule.cfg'
right... (2 Replies)
Discussion started by: potro
2 Replies
4. UNIX for Dummies Questions & Answers
I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies
5. Shell Programming and Scripting
I want to delete all lines from a file (orig_file) that contain the regex values (bad_inv_list)
I tried a for each loop with sed but it isn't working
for file in `cat bad_inv_list`;
do
sed '/$file/d' orig_file > pared_down_file.1
mv pared_down_file.1 orig_file
done
I've added... (2 Replies)
Discussion started by: verge
2 Replies
6. Shell Programming and Scripting
Hello, I have a file like this one:
03-07-2011 sunz02 message1
03-07-2011 sunz02 message2
03-07-2011 sunz02 message3
01-07-2011 sunz02 message1
01-07-2011 sunz02 message2
01-07-2011 sunz02 ... (1 Reply)
Discussion started by: asanchez
1 Replies
7. Shell Programming and Scripting
Hello,
I have a file filled with dates, such as:
04-08-2011 message
04-08-2011 message
03-08-2011 message
01-08-2011 message
31-07-2011 message
24-07-2011 message
15-07-2011 message
13-12-2008 message
26-11-2007 message
And I want to delete those lines whose date is older than 10... (5 Replies)
Discussion started by: asanchez
5 Replies
8. Shell Programming and Scripting
Hi friends,
I have one XML file having below structure :-
INput XML file :-
<?xml version="1.0" encoding="UTF-8"?>
<START>
<A=value1>
<attr name1="a1">
</A>
<B=value2>
<attr name2="b1">
<attr name3="c1">
</B>
</START>
output xml file should be
=== (3 Replies)
Discussion started by: harpal singh
3 Replies
9. UNIX for Dummies Questions & Answers
This could be a really dummy question.
I have a log text file.
What unix command to extract line from specific string to another specific string.
Is it something similar to?:
more +/"string" file_name
Thanks (4 Replies)
Discussion started by: aku
4 Replies
10. Shell Programming and Scripting
Hello All,
Since i'm relatively new in shell script need your guidance.
I'm copying files manually based on a specific word in a file name and its extension and then moving it into some destination folder.
so if filename contains hyr word and it has .md and .db extension; it will move to TUM/HYR... (13 Replies)
Discussion started by: prajaktaraut
13 Replies
LEARN ABOUT OPENSOLARIS
insdelln
insdelln(3XCURSES) X/Open Curses Library Functions insdelln(3XCURSES)
NAME
insdelln, winsdelln - insert/delete lines to/from the window
SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib
-R /usr/xpg4/lib -lcurses [ library... ]
c89 [ flag... ] file... -lcurses [ library... ]
#include <curses.h>
int insdelln(int n);
int winsdelln(WINDOW *win, int n);
PARAMETERS
n Is the number of lines to insert or delete (positive n inserts; negative n deletes).
win Is a pointer to the window in which to insert or delete a line.
DESCRIPTION
The insdelln() and winsdelln() functions insert or delete blank lines in stdscr or win, respectively. When n is positive, n lines are
added before the current line and the bottom n lines are lost; when n is negative, n lines are deleted starting with the current line,
the remaining lines are moved up, and the bottom n lines are cleared. The position of the cursor does not change.
RETURN VALUES
On success, these functions return OK. Otherwise, they return ERR.
ERRORS
None.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO
deleteln(3XCURSES), insertln(3XCURSES), libcurses(3XCURSES), attributes(5), standards(5)
SunOS 5.11 5 Jun 2002 insdelln(3XCURSES)