Sponsored Content
Top Forums UNIX for Advanced & Expert Users Match the string and copy records to another location Post 302277336 by bsandeep_80 on Friday 16th of January 2009 03:15:01 AM
Old 01-16-2009
Match the string and copy records to another location

Hi,

I have particular set of files which have the below contents:

****** PBX TYPE:ID6 PBX-id: A11 rolled on 123456 368763 00 >>>>>>
A11,2008-07-01 21:31:00.000,42,42112, ,XXXXXXXX
A11,2008-07-01 21:40:00.000,6, , ,XXXXXXX
A12,2008-07-01 21:53:00.000,68, , ,XXXXXXXX
A13,2008-07-01 21:55:00.000,8,XXXX, ,XXXXX
A11,2008-07-01 21:55:00.000,26, , ,XXXXX
A11,2008-07-01 21:55:00.000,26,XXXXX
****** PBX TYPE:GG3 PBX-id: A44 rolled on 011409 163401 00 >>>>>>
0237953 1234567890 T000018
0237953 1234567899 T000011
0236545 1234567870 T000023


I would want to copy the records starting with header as ****** PBX TYPE:ID6 to another location.

like :

****** PBX TYPE:ID6 PBX-id: A11 rolled on 123456 368763 00 >>>>>>
A11,2008-07-01 21:31:00.000,42,42112, ,XXXXXXXX
A11,2008-07-01 21:40:00.000,6, , ,XXXXXXX
A12,2008-07-01 21:53:00.000,68, , ,XXXXXXXX
A13,2008-07-01 21:55:00.000,8,XXXX, ,XXXXX
A11,2008-07-01 21:55:00.000,26, , ,XXXXX
A11,2008-07-01 21:55:00.000,26,XXXXX


How can i do that.

Thanks,
Sandeep
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

copy files from one location to similar location

I need help in forming a script to copy files from one location which has a sub directory structure to another location with similar sub directory structure, say location 1, /home/rick/tmp_files/1-12/00-25/ here 1-12 are the number of sub directories under tmp_files and 00-25 are sub... (1 Reply)
Discussion started by: pharos467
1 Replies

2. UNIX for Dummies Questions & Answers

Copy directory from one location to other

Hi All, I am newbie for Unix. I want to copy a directory from one location to other. Can any one help me by providing the command to do following task. thanks in advance, Rakesh (2 Replies)
Discussion started by: rakeshvthu
2 Replies

3. Shell Programming and Scripting

Put one string from one location to another location in a file

Hi Everyone, I have 1.txt here a b c' funny"yes"; d e The finally output is: here a b c d e' funny"yes"; (1 Reply)
Discussion started by: jimmy_y
1 Replies

4. Shell Programming and Scripting

Shell Script for Copy files from one location to another location

Create a script that copies files from one specified directory to another specified directory, in the order they were created in the original directory between specified times. Copy the files at a specified interval. (2 Replies)
Discussion started by: allways4u21
2 Replies

5. Shell Programming and Scripting

How to copy a file from one location to another location?

I have file file1.txt in location 'loc1'. Now i want a copy of this file in location 'loc2' with a new file called test.txt. Please help me how to do this in shell script. (1 Reply)
Discussion started by: vel4ever
1 Replies

6. Shell Programming and Scripting

Deleting duplicate records from file 1 if records from file 2 match

I have 2 files "File 1" is delimited by ";" and "File 2" is delimited by "|". File 1 below (3 record shown): Doc1;03/01/2012;New York;6 Main Street;Mr. Smith 1;Mr. Jones Doc2;03/01/2012;Syracuse;876 Broadway;John Davis;Barbara Lull Doc3;03/01/2012;Buffalo;779 Old Windy Road;Charles... (2 Replies)
Discussion started by: vestport
2 Replies

7. Shell Programming and Scripting

How to copy files from one location to another based on a priority?

Hi Gurus, I am a newbie to shell scripting and I am facing a problem right now.I have to automate the copy of files based on a priority.The scenario is as below: 1) There will be files from Mon-Fri with Mon file being named as abc_def_01_YYYYMMDD and Tue file being abc_def_02_YYYYMMDD and so... (4 Replies)
Discussion started by: vikramgk9
4 Replies

8. Shell Programming and Scripting

Copy files from one location to another

I have below files in one location /test/files and also for each dates there are similar files A20130924.0000-0005_file1 A20130924.0000-0005_file2 A20130924.0005-0010_file1 A20130924.0005-0010_file2 . . . A20130924.2355-0000_file1 A20130924.2355-0000_file2 If i execute the script like... (4 Replies)
Discussion started by: Saidul
4 Replies

9. Shell Programming and Scripting

How to copy files from one location to another using xargs??

Hello Experts, I need to copy files from one location to another using xargs. Tried something like this (In Ubuntu & Solaris ). mkdir -p 1234; find /home/emd/Desktop/n007/M007/ -type f -name "A2014*" | xargs -0 cp -r {} /home/emd/Desktop/1234 But every time i run this, a weird error... (6 Replies)
Discussion started by: Saidul
6 Replies

10. UNIX for Beginners Questions & Answers

Search a string and display its location on the entire string and make a text file

I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file. Please use CODE tags as... (7 Replies)
Discussion started by: ANKIT ROY
7 Replies
gvfs-copy(1)							   User Commands						      gvfs-copy(1)

NAME
gvfs-copy - copy a file from one VFS location to another SYNOPSIS
gvfs-copy source-URI destination-URI DESCRIPTION
gvfs-copy copies a file from one URI location to another, using the virtual file system. OPERANDS
The following operands are supported: source-URI Specifies the source file location in standard URI format. destination-URI Specifies the destination file or directory location in standard URI format. EXAMPLES
Example 1: Copying a File From a Web Server to a Local File example% gvfs-copy http://www.sun.com file:///home/user/index.html ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables: NLSPATH. EXIT STATUS
The exit value 0 is returned regardless of success or failure. FILES
The following files are used by this application: /usr/bin/gvfs-copy Executable to copy a file from one VFS location to another ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-gvfs | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
gvfs-cat(1), gvfs-info(1), gvfs-less(1), gvfs-ls(1), gvfs-mkdir(1) gvfs-monitor-dir(1), gvfs-monitor-file(1), gvfs-mount(1), gvfs-move(1), gvfs-rename(1), gvfs-open(1), gvfs-rm(1), gvfs-save(1), gvfs-trash(1), gvfs-tree(1), attributes(5), environ(5) NOTES
Written by Alvaro Lopez Ortega, Sun Microsystems Inc., 2008. SunOS 5.11 25 Mar 2008 gvfs-copy(1)
All times are GMT -4. The time now is 02:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy