Sponsored Content
Top Forums UNIX for Dummies Questions & Answers insert string at end of line if it found from list Post 302701129 by zozoo on Friday 14th of September 2012 06:17:38 PM
Old 09-14-2012
HI pamu thanks alot it worked Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert blank line if grep not found

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)
Discussion started by: michieka
6 Replies

2. Shell Programming and Scripting

How to insert a string at the end of a file read

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

3. Shell Programming and Scripting

insert new line at found chars

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)
Discussion started by: crowman
6 Replies

4. Shell Programming and Scripting

Insert two strings at the beginning and at the end of each line of a file

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)
Discussion started by: Linux-fueled
3 Replies

5. UNIX for Dummies Questions & Answers

insert period at the end of each line

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)
Discussion started by: tjmannonline
6 Replies

6. Shell Programming and Scripting

insert text at every end of the line

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)
Discussion started by: invinzin21
6 Replies

7. Shell Programming and Scripting

Insert blank line if grep not found

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)
Discussion started by: masterpiece
4 Replies

8. Shell Programming and Scripting

gawk (dos) insert backslash at end of line

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)
Discussion started by: sdf
6 Replies

9. Shell Programming and Scripting

Insert specific line when found similar value

Hi All, I have file like this: file1: 3778 10474 24 3778 10475 24 3778 10476 25 3778 10495 26 3794 10001 33 3794 10002 33 3794 10004 33 3794 10007 34 3794 10008 34 3794 10011 34 3794 10012 34 3794 10013 34 3794 10017 34 3810 10282 27 (6 Replies)
Discussion started by: attila
6 Replies

10. Shell Programming and Scripting

Insert line based on found string

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
curses(3x)																curses(3x)

Name
       curses - screen functions with optimal cursor motion

Syntax
       cc [ flags ] files -lcurses -ltermcap [ libraries ]

Description
       These  routines give the user a method of updating screens with reasonable optimization.  They keep an image of the current screen, and the
       user sets up an image of a new one.  Then the subroutine tells the routines to make the current screen look like the new one.  To  initial-
       ize  the  routines,  the  routine must be called before any of the other routines that deal with windows and screens are used.  The routine
       should be called before exiting.

Functions
       addch(ch)		     add a character to stdscr
       addstr(str)		     add a string to stdscr
       box(win,vert,hor)	     draw a box around a window
       clear()			     clear stdscr
       clearok(scr,boolf)	     set clear flag for scr
       clrtobot()		     clear to bottom on stdscr
       clrtoeol()		     clear to end of line on stdscr
       crmode() 		     set cbreak mode
       delch()			     delete a character
       deleteln()		     delete a line
       delwin(win)		     delete win
       echo()			     set echo mode
       endwin() 		     end window modes
       erase()			     erase stdscr
       getch()			     get a char through stdscr
       getcap(name)		     get terminal capability name
       getstr(str)		     get a string through stdscr
       gettmode()		     get tty modes
       getyx(win,y,x)		     get (y,x) co-ordinates
       inch()			     get char at current (y,x) co-ordinates
       initscr()		     initialize screens
       insch(c) 		     insert a char
       insertln()		     insert a line
       leaveok(win,boolf)	     set leave flag for win
       longname(termbuf,name)	     get long name from termbuf
       move(y,x)		     move to (y,x) on stdscr
       mvcur(lasty,lastx,newy,newx)  actually move cursor
       newwin(lines,cols,begin_y,begin_x) create a new window
       nl()			     set newline mapping
       nocrmode()		     unset cbreak mode
       noecho() 		     unset echo mode
       nonl()			     unset newline mapping
       noraw()			     unset raw mode
       overlay(win1,win2)	     overlay win1 on win2
       overwrite(win1,win2)	     overwrite win1 on top of win2
       printw(fmt,arg1,arg2,...)     printf on stdscr
       raw()			     set raw mode
       refresh()		     make current screen look like stdscr
       resetty()		     reset tty flags to stored value
       savetty()		     stored current tty flags
       scanw(fmt,arg1,arg2,...)      scanf through stdscr
       scroll(win)		     scroll win one line
       scrollok(win,boolf)	     set scroll flag
       setterm(name)		     set term variables for name
       standend()		     end standout mode
       standout()		     start standout mode
       subwin(win,lines,cols,begin_y,begin_x) create a subwindow
       touchwin(win)		     "change" all of win
       unctrl(ch)		     printable version of ch
       waddch(win,ch)		     add char to win
       waddstr(win,str) 	     add string to win
       wclear(win)		     clear win
       wclrtobot(win)		     clear to bottom of win
       wclrtoeol(win)		     clear to end of line on win
       wdelch(win,c)		     delete char from win
       wdeleteln(win)		     delete line from win
       werase(win)		     erase win
       wgetch(win)		     get a char through win
       wgetstr(win,str) 	     get a string through win
       winch(win)		     get char at current (y,x) in win
       winsch(win,c)		     insert char into win
       winsertln(win)		     insert line into win
       wmove(win,y,x)		     set current (y,x) co-ordinates on win
       wprintw(win,fmt,arg1,arg2,...) printf on win
       wrefresh(win)		     make screen look like win
       wscanw(win,fmt,arg1,arg2,...) scanf through win
       wstandend(win)		     end standout mode on win
       wstandout(win)		     start standout mode on win

See Also
       ioctl(2), getenv(3), termcap(3x), tty(4), termcap(5)
       Screen Updating and Cursor Movement Optimization: A Library Package, ULTRIX Supplementary Documents Vol. II:Programmer

																	curses(3x)
All times are GMT -4. The time now is 09:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy