[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sheflug] Extracing data from a file



Hi,
    A question for all you awk/sed/perl wizards out there. I have a
file which has a number of records in the following fashion

id_string
'i'
N
a1,b1
a2,b2
...
a_{N/2},b[N/2}


    After each of these records, a new one is found. I want to split
this single file into a number of files. Each new file will have the
name id_string, and the content of the file will be exactly the same
record that is present in the initial file. The number of a,b data
points is specified by N (there are N a and N b points).

    Can anyone shed any light? I have tried using cut&paste, but I
have of the order of 250 records on each of the 20 files, so it is a
bit _tedious_ 

    Thanks,
    Jose
-- 
José L Gómez Dans			PhD student
Tel: +44 114 222 5582			Radar & Communications Group
FAX; +44 870 132 2990			Department of Electronic Engineering
					University of Sheffield UK
___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.