Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi, i am having a merged document file in the below format,
[filename1.doc]
....
....
.....
[/filename1.doc]

[filename2.doc]
....
....
.....
[/filename2.doc]
[filename3.doc]
....
....
.....
[/filename3.doc]

now i need to split the three document files and save it with the same filename.doc using vb.net coding
Posted

Just Check out the following link.It will help you to Solve your problem

How to Split and Merge Two Files
 
Share this answer
 
You are apparently doing some development along the wrong lines. I remember your previous questions. First you wanted to merge files and had problem with this matter, not you want to split them back, so why merging them? You don't have to explain why. Instead, try to do yourself a great favor: stop this useless activity and get busy with something meaningful. For example, learn some programming, you really need it.

—SA
 
Share this answer
 
v2
The simplest way is probably to use a regex:
VB
Dim regex As New Regex("\[(?<filename>[^\]]*)\](?<text>.*)\[/\k<filename>\]", RegexOptions.IgnoreCase Or RegexOptions.Multiline Or RegexOptions.Singleline Or RegexOptions.CultureInvariant Or RegexOptions.IgnorePatternWhitespace Or RegexOptions.Compiled)
Dim ms As MatchCollection = regex.Matches(InputText)</filename></text></filename>
This captures each file into a separate match, each with two groups: "Filename" and "Text".
 
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