03-17-2011
Copy an entire file to specific position to another file
Hi ,
I need your kind help for my below requirement
I need to copy and entire txt file to a certain position to the target file .
Source file has 3 lines and it has to be copied to the target file in position from line 10 to 12.
Thanks for your support
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to add Pipe (|) at 5th and 18th position of all records a file. How can I do this?
I tried to add it at 5th position using the below code. It didnt work. Please help!!!
awk '{substr($0,5,1) ~ /|/}{print}' $input_file > $temp_file (1 Reply)
Discussion started by: gpaulose
1 Replies
2. Shell Programming and Scripting
Hello
I want to add some value at the specific position.
My file has data like
Hello
Welcome to UNIX Forums
Need Assistance
I want to add some value at the end but at same character position for all lines.
I want my output file to have data like :
Here '_' represents blanks.... (3 Replies)
Discussion started by: dashing201
3 Replies
3. UNIX for Dummies Questions & Answers
How to copy entire file content into another file being in last line mode of vi ?
---------- Post updated at 10:07 AM ---------- Previous update was at 09:56 AM ----------
Got it :
:1,30w file.txt (1 Reply)
Discussion started by: presul
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am trying to figure out how to copy the contents of a file to the clipboard, then paste into a command. i.e copy contents of file /path/filename.txt to <command> <paste text>
Hope that makes sense. Basically tryting to copy the text for use in a command without having to open the... (8 Replies)
Discussion started by: JCA70
8 Replies
5. Shell Programming and Scripting
Hi,
I have a file with the following structure.
XXXXX...........
YYYYY...........
.................
..................
ZZZZZZ......
qwerty_start..............
..................
.................
..................
querty_end................
.............................. (1 Reply)
Discussion started by: abinash
1 Replies
6. Shell Programming and Scripting
Hello Guys
I have a directory of xml files (almost 500 ) Now in each xml file 3 new attributes will be added which are in a different single file
Is there any way I can copy the whole content of single file at 6th line of all the files in the directory .
Thanks a lot!!! (7 Replies)
Discussion started by: Pratik4891
7 Replies
7. UNIX for Dummies Questions & Answers
Hi.
I need to write a script that will allow me to copy data from one position in a line to another position while changing the first 2 bytes of the data to a constant. Here is an example of a line of data before and what it needs to look like after. there are about 200 lines in the file.
... (1 Reply)
Discussion started by: wlb_shore_user
1 Replies
8. Shell Programming and Scripting
How to replace the position specific values in the file..
i searched a lot the forums but i couldn't able to do...
i have file like below
576666666666666666666666666 7878 897987 121 0asdas Y12
5900fbb 777 09JJJ 78798347892374 234234234364 234232898
89HJHIHIGIUG989902743748327khjkhkjlh... (6 Replies)
Discussion started by: greenworld123
6 Replies
9. Shell Programming and Scripting
Hi,
How do we write the contents of multiple files created in awk body to a new file in awk (END block) ? when I used "getline", it is consuming more time. Do we have any other way other than getline? (1 Reply)
Discussion started by: Cool
1 Replies
10. Shell Programming and Scripting
Hi I have a text file with lines beginning with 71303, 71403, 71602,
I need to copy the 10 digit text at position 30 on lines beginning with 71303 (5500011446) to position 99 on every line beginning with 71602 (see example below),
There may be many 71303 lines but I need the text copying to... (2 Replies)
Discussion started by: firefox2k2
2 Replies
LEARN ABOUT OPENSOLARIS
waddchstr
addchstr(3XCURSES) X/Open Curses Library Functions addchstr(3XCURSES)
NAME
addchstr, addchnstr, mvaddchstr, mvaddchnstr, mvwaddchnstr, mvwaddchstr, waddchstr, waddchnstr - copy a character string (with renditions)
to a 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 addchstr(const chtype *chstr);
int addchnstr(const chtype *chstr, int n);
int mvaddchnstr(int y, int x, const chtype *chstr, int n);
int mvaddchstr(int y, int x, const chtype *chstr);
int mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n);
int mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr);
int waddchstr(WINDOW *win, const chtype *chstr);
int waddchnstr(WINDOW *win, const chtype *chstr, int n);
DESCRIPTION
The addchstr() function copies the chtype character string to the stdscr window at the current cursor position. The mvaddchstr() and
mvwaddchstr() functions copy the character string to the starting position indicated by the x (column) and y (row) parameters (the former
to the stdscr window; the latter to window win). The waddchstr() is identical to addchstr(), but writes to the window specified by win.
The addchnstr(), waddchnstr(), mvaddchnstr(), and mvwaddchnstr() functions write n characters to the window, or as many as will fit on
the line. If n is less than 0, the entire string is written, or as much of it as fits on the line. The former two functions place the
string at the current cursor position; the latter two commands use the position specified by the x and y parameters.
These functions differ from the addstr(3XCURSES) set of functions in two important respects. First, these functions do not advance the
cursor after writing the string to the window. Second, the current window rendition is not combined with the character; only the
attributes that are already part of the chtype character are used.
PARAMETERS
chstr Is a pointer to the chtype string to be copied to the window.
n Is the maximum number of characters to be copied from chstr. If n is less than 0, the entire string is written or as much of it
as fits on the line.
y Is the y (row) coordinate of the starting position of chstr in the window.
x Is the x (column) coordinate of the starting position of chstr in the window.
win Is a pointer to the window to which the string is to be copied.
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
addch(3XCURSES), addnstr(3XCURSES), attroff(3XCURSES), libcurses(3XCURSES), attributes(5), standards(5)
SunOS 5.11 5 Jun 2002 addchstr(3XCURSES)