The UNIX and Linux Forums  


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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-02-2008
monicasgupta monicasgupta is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 6
Help Needed : Split one big file to multiple files

Hi friends,

I have data in flat file as following, first filed is the customer number. We have almost 50-100 customers in the system


100 ABC A123
100 BVC D234
100 BNC N324
200 CBC A122
200 AVC D294
200 HNC N324
300 GBC A173
300 FVC D234
300 DNC N344

I want to split the file and create individual file for each customer with customer number in the file name as follows,

File Name : 100.<TimeStamp>.txt

100 ABC A123
100 BVC D234
100 BNC N324

File Name : 200.<TimeStamp>.txt

200 CBC A122
200 AVC D294
200 HNC N324

File Name : 300.<TimeStamp>.txt

300 GBC A173
300 FVC D234
300 DNC N344

I really apprciate if anyone can help me writing this script.