Script Question: Spliting A File
Hello,
Here's a brain teaser for everyone. I have a file that has several sections in it that I need to split out into smaller files. Here is an example of such a file: Code:
BLAH BLAH BLAH I'm going to tackle this using PHP but I was wondering if someone could provide a bash,gawk or perl way. -- Tony -- Tony |
There is probably an easier way to do this, but here is a bash script I wrote that seems to accomplish the task. The script takes the name of the file you want to separate as an argument.
Code:
#!/bin/bash |
Does exactly what I wanted!
Thanks a lot! I spent a huge portion of the day doing this in PHP ... your script does it much nicer and cleaner. Thanks!
|
here's a much more simpler way,
Code:
# !/usr/bin/ksh |
my go ;)
Code:
#!/usr/bin/perl -w |
Code:
#!/bin/bash |
Quote:
could you please explain that? |
All times are GMT -5. The time now is 04:49 AM. |