Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod computer crash desktop drive driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory missing monitor motherboard network printer problem ram random registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Separate huge .doc file into multiple files

Reply  
Thread Tools
slurpee55's Avatar
Computer Specs
Distinguished Member with 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
05-Feb-2009, 10:34 AM #46
Oh, I tinkered around and I get it. Microsoft has written all 2007 files in compressed XML files, with different subfiles controlling various aspects of the item you see when you open, in this case, a document. If you change the format from docx to zip and open it, you will see those different files that the parser is displaying.
For instance, word/fontTable.xml lists all the available fonts when you open Word.
The file you want to parse is actually
word/document.xml
If you extract this from the zipped file, you should be able to parse it properly.
__________________
Iowa? I could have sworn this was heaven.
Well, I think I can answer this question most successfully in mime.
My theme song... | Affero - rate me!
Miss HK's Avatar
Junior Member with 21 posts.
 
Join Date: Jan 2009
Experience: Beginner
08-Feb-2009, 06:08 AM #47
Hi,

I changed the options in Word 2007 so that it would save everything in 2003 by default and now the parsing in working fine.

Guys, thank you so much for all the help, time and effort you've given me, I am so grateful you have no idea!!! You are really doing a great job and I am really surprised that there are people out there who so generously give without expecting anything back. I will be sure to make a decent donation, how much do people usually give, I don't have a great budget but all your help has been a huge time saver for me.

A very big thank you I will be recommending this site to my buddies!!!
Rollin_Again's Avatar
Senior Member with 4,273 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
08-Feb-2009, 10:48 AM #48
Miss HK,

Thanks for the update, we've glad you finally got this sorted. We enjoy helping people and it brings smiles to our faces to know we've made life easier for someone else. While some people enjoy doing crossword puzzles, Slurpee and I and many others on this site enjoy solving technical challenges we are presented with here. There is no standard amount that you should donate. This site is 100% run by volunteers and I'm sure that any donation received would be greatly appreciated. If you are really feeling generous, Slurpee and I would love to go to Hawaii for a week or two.

Regards,
Rollin

Last edited by Rollin_Again; 08-Feb-2009 at 03:22 PM..
slurpee55's Avatar
Computer Specs
Distinguished Member with 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
08-Feb-2009, 12:57 PM #49
LOL! I just got back from the Caribbean, Rollin, and haven't a lot of vacation left at this moment! Darn!
And you know what, Miss HK? I have learned far more here than I have - or will ever be able to - give back in advice and help. Hang around and you could become "one of us"!
__________________
Iowa? I could have sworn this was heaven.
Well, I think I can answer this question most successfully in mime.
My theme song... | Affero - rate me!
Miss HK's Avatar
Junior Member with 21 posts.
 
Join Date: Jan 2009
Experience: Beginner
11-Feb-2009, 02:16 AM #50
Ok, let me sort out winning the lottery first and 2 tickets to Hawai will be at the top of my to do list!
slurpee55's Avatar
Computer Specs
Distinguished Member with 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
11-Feb-2009, 10:56 AM #51
Glad to have helped - good to work with Rollin (at least some) again, too!
Miss HK's Avatar
Junior Member with 21 posts.
 
Join Date: Jan 2009
Experience: Beginner
03-Mar-2009, 08:15 AM #52
One last thing
Greetings from a girl who like to split files (and not hairs).

I've been playing around but without much success and have been going through allot of the postings.

Same problem, doc files needs splitting, if they could be saved/incrementing number.


Here's a sample the green is the first file that needs to be separated from the second in blue.

I initially thouth that Nationality: could be the word to split from, but there are some files where it doesnt appear.

Internal Auditor with 15 Years experience
</xxxxxxx/xxxxxx.html?xxxx=12345&abc=965412&kind=private&folderID=45486746&section=9& source=0>

Internal audit,assessing internal controls,system review,reporting and
Follow up
CA (Any) , Institute for Clever People

Last Active: long time ago



Salary per annum
Exp: 15 Years

Received Date: 16 Sep 2007


John Smith

Resume ID: 598856
Mobile: 1234567
Telephone: 891011
jsmith@hotmail.com
Nationality: Martian




CA with 9+ years experience and ERP exposure
</dbwedewhd/rfburwe.html?verq=46848&gver=8486&type=private&folderID=596745&section=8&so urce=0>

Chartered Accountant (CA), SAP user, ERP Implementation, Budgeting,
Accounts, Finance, MIS, Direct & Indirect Taxation & Commercial functions
CA (Any) , Institute of Numbers123
Languages Known: Many
Last Active: also not



Succes compnay Limited
Too much salary per annum
Exp: 11 Years

Received Date: 16 Sep 2007


Jane White

Resume ID: 623213
Mobile: 987654
Telephone: 321000
jane@gmail.com
Far Away

Nationality: Unknown


The Document then continues in the same manner, a different person, then another...


(More) help greatly appreciated!










slurpee55's Avatar
Computer Specs
Distinguished Member with 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
03-Mar-2009, 10:49 AM #53
Do they all have a line such as that beginning
</xxxxxxx/xxxxxx... as the second line?
Perhaps you could find that, move up one or two lines and split the file there?
Miss HK's Avatar
Junior Member with 21 posts.
 
Join Date: Jan 2009
Experience: Beginner
04-Mar-2009, 02:59 AM #54
Hi Slurpee, thanks for getting back to me so quickly.

The second lines all start with </ blahblahblahblah> but the text in between the brackets all change.

I think if the split occurs at Nationality: it should be ok. It's on most of the files, if the word doesn't appear, the error msg will come, and I can manually save and re-run the code. What do u think?

Cheers!
Miss HK's Avatar
Junior Member with 21 posts.
 
Join Date: Jan 2009
Experience: Beginner
04-Mar-2009, 09:01 AM #55
Actually, the </ blahblahblahblah> the words after the brackets start the same and then change fir the next person

ex
</ blahblahblahblahjohn>

</ blahblahblahblahjane
>

</ blahblahblahblahpeter
>

Is it possible with one code to delete the beginning of the file. Basically I have a two pages of text (more or less identical in format and content) that I need to delete at the beginning of each file i plan to run this code on.

I have attached a sample copy of the file

In red is what needs to be removed
In yellow are the places we could split from.
In green is what you suggested could be moved above.
The other pretty colours are just to differentiate the parts of the next that need to be split into a new file.
Attached Files
File Type: doc split sample.doc (37.5 KB, 159 views)
slurpee55's Avatar
Computer Specs
Distinguished Member with 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
04-Mar-2009, 12:31 PM #56
Is this an XML file - or originally from an XML file?
slurpee55's Avatar
Computer Specs
Distinguished Member with 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
04-Mar-2009, 12:35 PM #57
However, if you just inserted gibberish and it ended up looking like XML by chance, (it was all those "</..." at the start of your file that made me think it was XML) then probably Rollin's code could be altered fairly easily to do the job.
slurpee55's Avatar
Computer Specs
Distinguished Member with 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
04-Mar-2009, 12:59 PM #58
code error
Rollin, I tried this small change on your code
Code:
Sub SplitFiles()

vPath = ActiveDocument.Path & "\"

Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Text = "Nationality:"

vFirstRecord = True
i = 1

Do While Selection.Find.Execute = True

If vFirstRecord = False Then

Selection.MoveDown Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdStory, Extend:=wdExtend
Selection.Cut
Documents.Add DocumentType:=wdNewBlankDocument
Selection.Paste
Selection.HomeKey Unit:=wdStory

Do While Selection.Text <> "N"
Selection.Delete Unit:=wdCharacter, Count:=1
Loop

Selection.EndKey Unit:=wdLine, Extend:=wdExtend
vFrom = Replace(Left(Replace(Trim(Mid(Selection.Text, 6)), "@", "_"), Len(Replace(Trim(Mid(Selection.Text, 6)), "@", "_"))), Chr(11), "")
vFrom = Replace(vFrom, Chr(9), "")
vFrom = Replace(vFrom, Chr(13), "")

ActiveDocument.SaveAs (vPath & vFrom & "_" & i & ".doc")
i = i + 1
ActiveDocument.Close
vFirstRecord = True

Else

vFirstRecord = False

End If

Loop

Selection.EndKey Unit:=wdLine, Extend:=wdExtend
vFrom = Replace(Left(Replace(Trim(Mid(Selection.Text, 6)), "@", "_"), Len(Replace(Trim(Mid(Selection.Text, 6)), "@", "_"))), Chr(11), "")
vFrom = Replace(vFrom, Chr(9), "")
vFrom = Replace(vFrom, Chr(13), "")
Selection.HomeKey Unit:=wdStory

Do While Selection.Text <> "N"
Selection.Delete Unit:=wdCharacter, Count:=1
Loop

ActiveDocument.SaveAs (vPath & vFrom & "_" & i & ".doc")
Application.Quit

End Sub
and it takes the first set of data down to the line after Nationality (I converted all the lines in yellow to say Nationality:...) and saves it (although if that beginning stuff in red is not something you want, just delete it) but then it gives me an error code 5152 and says the name is not a valid file name.
I'm just running it on my desktop, and the first file gets saved there....
__________________
Iowa? I could have sworn this was heaven.
Well, I think I can answer this question most successfully in mime.
My theme song... | Affero - rate me!
slurpee55's Avatar
Computer Specs
Distinguished Member with 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
04-Mar-2009, 01:11 PM #59
Okay, another move onward:
I removed this from the above
vFrom = Replace(Left(Replace(Trim(Mid(Selection.Text, 6)), "@", "_"), Len(Replace(Trim(Mid(Selection.Text, 6)), "@", "_"))), Chr(11), "")
vFrom = Replace(vFrom, Chr(9), "")
vFrom = Replace(vFrom, Chr(13), "")
and altered this line to read
ActiveDocument.SaveAs (vPath & "_" & i & ".doc")
and now I am getting files called _1.doc, _2.doc
Unfortunately, I am only getting files consisting of the 2nd and 4th chunks of info - the first and 3rd just vanish except for the phrase "Nationality: Mndmz" appearing at the the top of the file....
__________________
Iowa? I could have sworn this was heaven.
Well, I think I can answer this question most successfully in mime.
My theme song... | Affero - rate me!
slurpee55's Avatar
Computer Specs
Distinguished Member with 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
04-Mar-2009, 04:05 PM #60
Smile I think this on the order of what the OP wants
Note that I have inserted the junk at the beginning - I suspect it needs to be deleted first.
Attached Files
File Type: doc split sample with data from first example.doc (35.0 KB, 147 views)
Reply

Tags
files, macro, split, word

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:24 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.