I have a file of around 300 lines in which string "SERVER" occurs around 32 times.
for eg.
I need to split files like, for eg
I am using this code
awk '/SERVER/{n++}{print > f n}' f=/vikas/list /vikas/final
But the problem is that it makes maximum of 10 files, but I need more than 30.
I have tried using nawk, but didnt worked.
I am using bash scripting on Sun OS.
hey, this command worked.
Thanks a ton friend. Its running on my Linux machine smoothly.
Now I have to check it on Solaris machine, will do that tomorrow.
Thanks again.
I tried lots of commands including the above ones. They all run fine on Linux machines
BUT not on the solaris machines, dont know the reason behind it.
Anyways, MANY MANY THANKS to all for your time and help. I found this command to work perfectly.
/usr/xpg4/bin/awk '/SERVER/{n++}{print > f n}' f=/vikas/list /vikas/final