I must have completely misunderstood what zozoo wanted to do. I thought that given the files list and file1 specified in the first message, you wanted output that looked like:
If that is what you wanted, I got the above output by running the awk command:
This User Gave Thanks to Don Cragun For This Post:
Hello everyone... please help if you can -- I'm stumped. Making this work will save me hours of manual labor:
I need to search file2 for pattern in file1. If pattern found append file2 line to file3. If pattern not found append a blank line to file3.
file1 contents example:
123
456
789... (6 Replies)
Hi,
This thread is an extension of the post I posted in another folder for Unix Dummies.
I am actually trying to read all the files in a folder, let say folder A.
There are alot of .txt files in this folder where I have sed them and translate to numeric elements.
For example:-
I have... (5 Replies)
Hey gang,
I have:
XXZZXXZZXX 123 asdaffggh dfghyrgr ertyhdhh XXZZXXZZXX 234 sdg XXZZXXZZXX 456 gfg fggfd
That is all on one line. Very simply put I want to do is something like:
sed s'/XXZZXXZZXX /\n/g'
or
tr 'XXZZXXZZXX ' '/n'
I have tried various things but can never get the desired... (6 Replies)
Hi, excuse me for my poor english.
My problem is that:
I have a File
i want to add to each line of that file two strings: one at the beginning of the line, one at the ending.
string1="abcd"
string2="efgh"
i want $string1 content $string2 for each line.
Is that possible? (3 Replies)
file1 contains:
this is a test
this is a test and only a test
this is another test
this is another test and only another only
i'd like my file to look like this:
this is a test.
this is a test and only a test.
this is another test.
this is another test and only another only. (6 Replies)
Hi,
I just wanted to know if you have any idea or script to insert a text at everyend of the line, the text will vary. for example
sample:
this is line1 ok
this is line2 ok
this is line3 ok
output:
this is line1 ok /home/line1.txt
this is line2 ok /home/line2.txt
this is line3 ok... (6 Replies)
Hi all,
I've googling around forum regarding my prob, the nearest would same as thread tittled Insert blank line if grep not found, but she/he did not mention the solution, so I would like to request your help
I've this task, to search in file2 based on pattern in file1 and output it to... (4 Replies)
I have created with the DOS-command dir a list of a directory.
Directory of C:\Users\User\Documents
09.06.2011 20:50 48.322 file1.txt
02.11.2010 23:00 9.216 file2.txt
15.12.2010 21:06 26.793 file2.txt
Now i would like to add the directory ahead of the filename. Therefore a... (6 Replies)
Hi All
I'm trying to insert a new line at the before each comment line in a file.
Comment lines start with '#-----'
there are other comments with in lines but I don't want a new line there.
Example file:
blah
blah #do not insert here
#this is a comment
blah #some more
#another comment... (10 Replies)
Discussion started by: Mudshark
10 Replies
LEARN ABOUT OPENSOLARIS
scrollok
clearok(3XCURSES) X/Open Curses Library Functions clearok(3XCURSES)NAME
clearok, idlok, leaveok, scrollok, setscrreg, wsetscrreg - terminal output control functions
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 clearok(WINDOW *win, bool bf);
int idlok(WINDOW *win, bool bf);
int leaveok(WINDOW *win, bool bf);
int scrollok(WINDOW *win, bool bf);
int setscrreg(int top, int bot);
int wsetscrreg(WINDOW *win, int top, int bot);
DESCRIPTION
These functions set options that deal with the output within Curses functions.
The clearok() function assigns the value of bf to an internal flag in the specified window that governs clearing of the screen during a
refresh. If, during a refresh operation on the specified window, the flag in curscr is TRUE or the flag in the specified window is TRUE,
clearok() clears the screen, redraws it in its entirety, and sets the flag to FALSE in curscr and in the specified window. The initial
state is unspecified
The idlok() function specifies whether the implementation may use the hardware insert-line, delete-line, and scroll features of terminals
so equipped. If bf is TRUE, use of these features is enabled. If bf is FALSE, use of these features is disabled and lines are instead
redrawn as required. The initial state is FALSE.
The leaveok() function controls the cursor position after a refresh operation. If bf is TRUE, refresh operations on the specified window
may leave the terminal's cursor at an arbitrary position. If bf is FALSE, then at the end of any refresh operation, the terminal's cursor
is positioned at the cursor position contained in the specified window. The initial state is FALSE.
The scrollok() function controls the use of scrolling.If bf is TRUE, then scrolling is enabled for the specified window. If bf is FALSE,
scrolling is disabled for the specified window. The initial state is FALSE.
The setscrreg() and wsetscrreg() functions define a software scrolling region in the current or specified window. The top and bottom argu-
ments are the line numbers of the first and last line defining the scrolling region. (Line 0 is the top line of the window.) If this option
and scrollok() are enabled, an attempt to move off the last line of the margin causes all lines in the scrolling region to scroll one line
in the direction of the first line. Only characters in the window are scrolled. If a software scrolling region is set and scrollok() is not
enabled, an attempt to move off the last line of the margin does not reposition any lines in the scrolling region.
PARAMETERS
win Is a pointer to a window.
bf Is a Boolean expression.
top Is the top line of the scrolling region (top of the window is line 0).
bot Is the bottom line of the scrolling region (top of the window is line 0).
RETURN VALUES
Upon successful completion, the setscrreg() and wsetscrreg() functions return OK. Otherwise, they return ERR.
The other functions always return OK.
ERRORS
No errors are defined.
USAGE
The only reason to enable the idlok() feature is to use scrolling to achieve the visual effect of motion of a partial window, such as for
a screen editor. In other cases, the feature can be visually annoying.
The leaveok() option provides greater efficiency for applications that do not use the cursor.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO bkgdset(3XCURSES), clear(3XCURSES), doupdate(3XCURSES), libcurses(3XCURSES), scrl(3XCURSES), attributes(5), standards(5)SunOS 5.11 5 Jun 2002 clearok(3XCURSES)