Click here to Skip to main content
15,889,874 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
how to split text file and copy it to another text file.
Posted
Updated 9-Nov-11 5:37am
v2
Comments
Albert Holguin 9-Nov-11 11:19am    
How do you want to split your file? Depending on what you want to achieve (split in half versus remove some header versus some other thing), the solution will be different.

1 solution

It really depends on how complex the splitting will be. For a very simple kind of splitting it might suffice for you to use str_tok which breaks up a string on a specified set of delimiters. See here: http://www.cplusplus.com/reference/clibrary/cstring/strtok/[^].

For more complex work you may want to resort to using regular expressions[^]. See here for the MSDN documentation: http://msdn.microsoft.com/en-us/library/4384yce9(v=vs.80).aspx[^].

Cheers!

—MRB
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900