in reply to Splitting long file
Then just run (assuming this is saved as split_big_file):#!/usr/bin/awk -f /^\$$/ { print >file close(file) file = "" next } { if (file == "") { file=$0 } print >file }
( Oh wait, ah, this isn't awkmonks? Sorry, wrong monastery... ) Well, errrm, just take the previously mentioned file, and run:split_big_file big_file
to get the perl version :-)a2p split_big_file
Updated. Fixed close statement (put parens around 'file' arg). Changed 'continue' to 'next' (although the awk worked-it didn't complain anyway, it confused a2p).
|
|---|