Sponsored Content
Full Discussion: copying content of a file
Top Forums UNIX for Dummies Questions & Answers copying content of a file Post 65466 by talzohar on Saturday 5th of March 2005 09:51:28 AM
Old 03-05-2005
copying content of a file

Hi,

I have a file in my unix system let's call it FileName.
First I want to copy its content into a another file, but outside of the unix, meaning I could open it at home. (text file would be perfect)
Second (if it's possible) I need to take the first word of each line in the file (you know the first word has ended when you get to a ":" , than to each first word I need to add the same suffix (let call it SUF), and separate each first word and suffix with a ";" semi-column.
Than the result I would like to print, either on the screen or even better to a file.

can anybody help???

Thanks, Smilie

Tal
*****

Last edited by vgersh99; 03-05-2005 at 11:54 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copying selected content from file

I want to capture contents of a file between 2 strings into another file for eg all lines in between the keywords "start log" and "end log" should be copied into another file (1 Reply)
Discussion started by: misenkiser
1 Replies

2. UNIX for Dummies Questions & Answers

Copying the content of a filesystem to different Harddrive

my server runs solaris 10 , one of the partition in my primary harddrive is 99% full , i want to move the contents of it to the second harddrive . what is the best way to move the contents to 2nd drive ? which command should i use cpio/dd/tar/ufsdump .... please guide me with the command and the... (0 Replies)
Discussion started by: skamal4u
0 Replies

3. Solaris

Copying the content of a filesystem to different Harddrive

my server runs solaris 10 , one of the partition in my primary harddrive is 99% full , i want to move the contents of it to the second harddrive which has higher capacity. what is the best way to move the contents to 2nd drive ? which command should i use cpio/dd/tar/ufsdump .... please guide me... (1 Reply)
Discussion started by: skamal4u
1 Replies

4. UNIX for Dummies Questions & Answers

Help with searching for a file in a directory and copying the contents of that file in a new file

Hi guys, I am a newbie here :wall: I need a script that can search for a file in a directory and copy the contents of that file in a new file. Please help me. :confused: Thanks in advance~ (6 Replies)
Discussion started by: zel2zel
6 Replies

5. Shell Programming and Scripting

To tar the content while copying files

Any idea on how we can tar the content while copying the files from one location to another location using the bash script. (2 Replies)
Discussion started by: gsiva
2 Replies

6. Shell Programming and Scripting

Copying lines from multiple logfiles, based on content of the line

d df d d (1 Reply)
Discussion started by: larsk
1 Replies

7. Shell Programming and Scripting

Shell :copying the content from one file to another

I have a log containing the below lines. file1.log ----------- module: module1 module10 module2 module002 module9 moduleRT100.2.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... (1 Reply)
Discussion started by: giridhar276
1 Replies

8. Shell Programming and Scripting

Sed: replace content from file with the content from file

Hi, I am having trouble while using 'sed' with reading files. Please help. I have 3 files. File A, file B and file C. I want to find content of file B in file A and replace it by content in file C. Thanks a lot!! Here is a sample of my question. e.g. (file A: a.txt; file B: b.txt; file... (3 Replies)
Discussion started by: dirkaulo
3 Replies

9. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies
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)
All times are GMT -4. The time now is 02:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy