11-26-2008
Copying/Extracting from line A to line B
Can any one please help me to copy file content between particualr line numbers.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
grep "KeyNotFoundException" weblogic.log
After running this command the output is
abcxyzexceptions.KeyNotFoundException: Person not found
How to know ..what is the line number of the above string in the log file. (2 Replies)
Discussion started by: bishweshwar
2 Replies
2. Shell Programming and Scripting
i want to cut all the entries from the /etc/passwd file in which the uid is> 500
for this i was writing this ,m quiet new to all this.. scripting
but on the 6th n 8th line ,, i hav to specify a line number .. to get the commnd working .. but i want to use variable i instead of that ,,... (2 Replies)
Discussion started by: narendra.pant
2 Replies
3. Shell Programming and Scripting
Dear community,
I'm quite a newbie with scripting, I have this problem:
I have a file with many lines and I want to copy the lines from 1 to N to file.1, from N+1 to 2N to file.2, and so on up to the end of the file
I have tried with something like this (N=43 in this example):
awk '{for... (2 Replies)
Discussion started by: paolalup
2 Replies
4. Shell Programming and Scripting
Hello all
i know it is pretty hard one but you will manage it all
after noticing and calculating i find a rhythm for the file i want to edit
to copy the last 12 characters in line but the problem is to add after first 25 characters in same line
in other way too copy the last 12 characters... (10 Replies)
Discussion started by: princesasa
10 Replies
5. Shell Programming and Scripting
Hi Guys,
the command ":yy" copies the line but it can be pasted in the same file. How can it be done if I want to copy it in other file. (2 Replies)
Discussion started by: ajincoep
2 Replies
6. Shell Programming and Scripting
Hi All,
I need to copy a specific line from a file to another file.
lets suppose the line number 13 of a file
when I am writing the line number explicitly.. its working fine
sed -n '13p' afile > anotherfile
but, when inside a script, i am getting the line number value inside a variable... (4 Replies)
Discussion started by: gotamp
4 Replies
7. UNIX for Dummies Questions & Answers
hi all,
i am newbie to Unix scripting..
I am writing a script which will have a line of commands, which needs to be copied to clipboard.
Any ideas welcome..
Usage::
I am using the script in this way, The script will have some lines (like below)
export TERM=xterm; cd test_env; TMOUT=0
... (1 Reply)
Discussion started by: gkarthik.gk
1 Replies
8. Shell Programming and Scripting
Hi,
I have a file as such
1 <text1><text2></
2 <text3><text4></
3 <text5><text6></
4 <text7><text8></
I need is so the first bit of text in the line is at the end as its xml so
1 <text1><text2></text1>
2 <text3><text4></text3>
3 <text5><text6></text5>
4 ... (12 Replies)
Discussion started by: legolad
12 Replies
9. Shell Programming and Scripting
Hi All,
I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies
10. UNIX for Beginners Questions & Answers
Input file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
LEARN ABOUT DEBIAN
ns_conncopytofd
Ns_ConnCopy(3aolserver) AOLserver Library Procedures Ns_ConnCopy(3aolserver)
__________________________________________________________________________________________________________________________________________________
NAME
Ns_ConnCopyToChannel, Ns_ConnCopyToDString, Ns_ConnCopyToFd, Ns_ConnCopyToFile - Copy request content to open file or dstring
SYNOPSIS
#include "ns.h"
int
Ns_ConnCopyToChannel(conn, ncopy, chan)
int
Ns_ConnCopyToDString(conn, ncopy, dsPtr)
int
Ns_ConnCopyToFd(conn, ncopy, fd)
int
Ns_ConnCopyToFile(conn, ncopy, fp)
ARGUMENTS
Ns_Channel chan (in) Pointer to Tcl channel open for write.
Ns_Conn conn (in) Pointer to open connection.
Ns_DString dsPtr (in) Initialized dstring.
int fd (in) File descriptor open for write.
FILE fp (in) Stdio FILE pointer open for write.
int ncopy (in) Number of bytes to copy.
_________________________________________________________________
DESCRIPTION
These functions copy content from an open connection request to the given open file descriptor, FILE, dstring, or Tcl_Channel. The rou-
tines work by copying from the content buffer; see the man page on Ns_ConnContent for how this buffer is managed for both small and large
requests.
The functions all return the number of bytes copied which will match the requested ncopy argument unless there is an error writing the con-
tent or the requested bytes is greater than the number of bytes still available to be read. An internal offset into the connection is
maintained and is shared with routines such as Ns_ConnRead which also consume content from the same buffer. Note that routines which
access the entire content, e.g., Ns_ConnContent, Ns_ConnContentFd, or Ns_ConnGetQuery will continue to provide access to the entire request
regardless if one of the Ns_ConnCopy or Ns_ConnRead functions have been used.
EXAMPLES
The following example demonstrates copying user data to a temp file:
fd = open("myfile.out", O_WRONLY|O_BINARY);
len = Ns_ConnContentLength(conn);
if (Ns_ConnCopyToFd(conn, len, fd) != len) {
... error writing content or content already consumed ...
}
SEE ALSO
Ns_ConnRead(3), Ns_ConnReadLine(3), Ns_ConnContent(3), Ns_ConnContentFd(3)
KEYWORDS
connection, content, read
AOLserver 4.0 Ns_ConnCopy(3aolserver)