The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell scripting sreejith SUN Solaris 2 10-08-2006 09:38 AM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 08:12 AM
Help on SED AWK in shell scripting kaushys Shell Programming and Scripting 3 03-09-2006 02:40 PM
Shell scripting sendhil Shell Programming and Scripting 1 02-14-2006 12:16 PM
Shell scripting dipanrc Shell Programming and Scripting 4 10-27-2005 03:53 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-11-2008
subhendu81 subhendu81 is offline
Registered User
  
 

Join Date: Sep 2008
Location: mumbai
Posts: 78
shell scripting

hi experts,
how can i separate the files contaiing several lines as
/common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample.gz
/common/interface/inbound/na/data/pre-receive/gadtest/subhendu/sample1.gz

i mean i want 2 separate the files sample.gz and sample1.gz and redirect them into an output file.

can u please help me reagrding this?

Immediate response is appreciable.

Last edited by subhendu81; 09-11-2008 at 05:30 AM.. Reason: to make it clear
  #2 (permalink)  
Old 09-11-2008
kaustav_pal kaustav_pal is offline
Registered User
  
 

Join Date: Mar 2008
Location: Kolkata, India
Posts: 4
Subhendu, Can you please tell what actually you mean saying "separate".

An elaborate problem description would help the forum to help you.
  #3 (permalink)  
Old 09-11-2008
subhendu81 subhendu81 is offline
Registered User
  
 

Join Date: Sep 2008
Location: mumbai
Posts: 78
shell scripting

i just want to cut the filenames sample.gz and sample.gz from the file which contains absolutepath and file name.
  #4 (permalink)  
Old 09-11-2008
kaustav_pal kaustav_pal is offline
Registered User
  
 

Join Date: Mar 2008
Location: Kolkata, India
Posts: 4
you can use

Quote:
grep -E "sample.gz|sample1.gz" <source_file>
hope this will work
  #5 (permalink)  
Old 09-11-2008
subhendu81 subhendu81 is offline
Registered User
  
 

Join Date: Sep 2008
Location: mumbai
Posts: 78
actually i want 2 cut the file names for record more than 30000....so i cann't specify partcular file names to use grep command.

can u plz tell me the way 2 cut the file names for a large file?
  #6 (permalink)  
Old 09-11-2008
kaustav_pal kaustav_pal is offline
Registered User
  
 

Join Date: Mar 2008
Location: Kolkata, India
Posts: 4
well put all the matching patterns in single file say pattern.dat

then you can use following

Quote:
cat pattern.dat
sample.gz
sample1.gz

grep -f pattern.dat source_file
you can manipulate contents of pattern.dat and get matchings accordingly
  #7 (permalink)  
Old 09-11-2008
subhendu81 subhendu81 is offline
Registered User
  
 

Join Date: Sep 2008
Location: mumbai
Posts: 78
my requirement are:

1.i have to find the zip files from the file
2.unzip all the files
3.again save the unzipfiles with absolute path which is defined in that file.


how can i make pattern file for file containing morethan 30000 records....its not possible

can u plz tell me in details...

Last edited by subhendu81; 09-11-2008 at 06:12 AM.. Reason: for more information
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0