The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Ksh Storing Multiple Files and reading each line in each file. developncode UNIX for Dummies Questions & Answers 1 04-08-2008 01:44 PM
Splitting the data and storing it into 2 variables jisha Shell Programming and Scripting 10 02-17-2008 07:40 PM
unzip particular gzip files among the normal data files thepurple Shell Programming and Scripting 4 11-30-2007 08:17 AM
Storing data of files Fr0z3n999 UNIX for Dummies Questions & Answers 1 12-09-2006 06:47 PM
awk - storing data in variables 2nilotpal Shell Programming and Scripting 7 04-16-2004 02:32 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-11-2008
Registered User
 

Join Date: Mar 2006
Posts: 11
Storing data to many files

Please help me store the content of Input file to many files.

Input file:
record
a
b
c
record
d
record
e
f
record
.....

Create file1:
a
b
c
Create file2:
d
Create file3:
e
f

etc.
Reply With Quote
Forum Sponsor
  #2  
Old 06-12-2008
robotronic's Avatar
Can I play with madness?
 

Join Date: Apr 2002
Location: Italy
Posts: 370
Code:
awk 'BEGIN { ORS=""; RS="record\n"; } NR>1 { print > "file" ++i; }' input_file.txt
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0