Splitting file
Hello
I have one file which is around 20MB. File name = ABCD_XYZ_20130302223203.xml wanted to split up into four files of each size of 5 MB. Requirement is that to write script which should do as : first three file should be of size 5 MB each, the fourth one content should be in the last file whatever it may be less or more than 5 MB. *Splitted file name should be same as the original with appeneding 1,2,3. I have used split -b 5M ABCD_XYZ_20130302223203.xml but its splitting in file name as xaa xab xac xad Appreciate your help in this. |
so read the man page of split:
Code:
split [OPTION]... [INPUT [PREFIX]] |
Thanks for your advice
My Box is AIX and I dont a have -d option for numeric suffix. I am using filename="ABCD_XYZ_20130302223203.xml" split -b 5M -a2 $filename "${filename}_" got some output like ABCD_XYZ_20130302223203.xml_aa ABCD_XYZ_20130302223203.xml_ab But the expected one as... ABCD_XYZ_20130302223203_1.xml ABCD_XYZ_20130302223203_2.xml OR Same name for all splitted files as original like ABCD_XYZ_20130302223203.xml ABCD_XYZ_20130302223203.xml ABCD_XYZ_20130302223203.xml ABCD_XYZ_20130302223203.xml Appreciate your input. |
[aix sux]
this could be messy but: Code:
i=0;for file in x* |
All times are GMT -5. The time now is 04:03 AM. |