File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes General Computing and the fly likes Unix Ksh split command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Unix Ksh split command" Watch "Unix Ksh split command" New topic
Author

Unix Ksh split command

yuga devi
Greenhorn

Joined: Aug 07, 2008
Posts: 22
Hi,

I am new to unix.

I have the following code to grep the word "System" from my Test.jav and split the output to multiple files of 2 lines each.
My code is :

grep 'System' Test.java | split -l 2

which splits correctly and fill the output in the files from the split command xaa, xab,xac...etc.

I want to have my own name in the files like test1,test2,test3 etc.

Please help

--Yug


fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10916
    
  12

csplit might be a better one to use... check its man page.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
yuga devi
Greenhorn

Joined: Aug 07, 2008
Posts: 22
Thanks for the reply!!
 
 
subject: Unix Ksh split command
 
Similar Threads
grep the String under subdirectories - --exclude not working
Editing Environment Variables
Get the exact string - not the entire line using grep
how to use grep in regular expression java
unix split command