孤星兄的这个代码我不太明白,既然以“#fengefu#”作为分隔标记,为什么代码里没有“#fengefu#“呢?#号只是我举的一个分割标记的例子没什么特殊含义,为了说的更清楚一点,我再举个例子吧。比如像下面这个TXT文件
zheshifengefuThere are many ways on how you can lose weight quickly. Rapid weight loss is achieved through sheer dedication and proper motivation. The way you change your lifestyle is also important to sustain a physically fit body. You should consciously set your goals so that you can motivate yourself in losing that unwanted weight, the most important thing to remember is to maintain a healthy quality way of life.
zheshifengefuThe best way to lose weight fast is to reduce your daily calorie intake. You do not have to starve yourself to death. You simply have to stop heaving junk food. You can readily have an instant soup instead of a greasy burger for lunch. You should also avoid eating fried foods. You will find that the grilled chicken meat is as good as the fried one, but much healthier. You also need to reduce the sugary foods you consume to the very minimum. You have to forget about the chocolate bars you have for snacks and about the ice cream after dinner.
zheshifengefuYou can have any other foods including meat and dairy, but you have to improve your eating habits as well. This is another effective method with which you can slim down quickly. It is essential for you to have a hearty, but not fattening breakfast. The oatmeal is an excellent choice. You should also have a good meal at lunch. Your dinner meal has to be as small as possible. It is good to start your lunch and dinner with a big filling salad without any dressing. The two snacks in between the meals are important for effective weight loss. You can have any fruit or nuts.
zheshifengefuOne of the really fast ways to lose weight is to drink more fluids. The water should be your top choice. By having eight glasses a day you will improve the functioning of your metabolism. Also, when you drink water before a meal you will eat less. You can readily replace this drink with green tea. It speeds up the metabolism even more. Plus, it aids digestion and gives you more energy.
假设上面的内容是一个TXT文件,这里我以”zheshifengefu“这个字符串作为分隔标记(分隔标记是所有TXT文件在未切分之前就已加好的),目的是把这个TXT文件分成下面4个单独的TXT文件:
There are many ways on how you can lose weight quickly. Rapid weight loss is achieved through sheer dedication and proper motivation. The way you change your lifestyle is also important to sustain a physically fit body. You should consciously set your goals so that you can motivate yourself in losing that unwanted weight, the most important thing to remember is to maintain a healthy quality way of life.
The best way to lose weight fast is to reduce your daily calorie intake. You do not have to starve yourself to death. You simply have to stop heaving junk food. You can readily have an instant soup instead of a greasy burger for lunch. You should also avoid eating fried foods. You will find that the grilled chicken meat is as good as the fried one, but much healthier. You also need to reduce the sugary foods you consume to the very minimum. You have to forget about the chocolate bars you have for snacks and about the ice cream after dinner.
You can have any other foods including meat and dairy, but you have to improve your eating habits as well. This is another effective method with which you can slim down quickly. It is essential for you to have a hearty, but not fattening breakfast. The oatmeal is an excellent choice. You should also have a good meal at lunch. Your dinner meal has to be as small as possible. It is good to start your lunch and dinner with a big filling salad without any dressing. The two snacks in between the meals are important for effective weight loss. You can have any fruit or nuts.
One of the really fast ways to lose weight is to drink more fluids. The water should be your top choice. By having eight glasses a day you will improve the functioning of your metabolism. Also, when you drink water before a meal you will eat less. You can readily replace this drink with green tea. It speeds up the metabolism even more. Plus, it aids digestion and gives you more energy.
这里我设定的分隔标记是”zheshifengefu“,那么遍历整个目录所有TXT文件并按照这个标记进行切分的完整代码是什么呢?谢谢了
[ 本帖最后由 zxzl 于 2010-5-20 22:52 编辑 ] |