I have several xml files. They're very big, and my computer is quite slow. I can't open them in notepad. What is the fastest, easiest way to divide these files into equal parts, still in xml format, in Windows?
Asked
Active
Viewed 77 times
0
-
Do the individual files have to be *valid* XML? – Harry Johnston Jan 16 '12 at 01:00
-
harry, They don't have to have headers, if that's what you mean. If I can just reduce the file sizes, I can open them and edit them to make them valid, manually, you know? I figure that's a maximum of 30 operations. So, no, they don't. – Wolfpack'08 Jan 16 '12 at 01:39
1 Answers
0
- Install
MSYS
for Windows You can then use the
sed
command to pipe chunks of your file into another temp file.sed -n [start],[end]p filename > tmp.xml
where, [start]
is the starting line number, and, [end]
is the ending line number. Of course, you'll have to run this command repeatedly. And, you'll need to know the total number of lines to divide the file into equal parts.

anirvan
- 4,797
- 4
- 32
- 42
-
anirvan, I don't know how to get the number of lines the file contains. Could you tell me that as well? It doesn't really need equal parts. Is there an `EOF` option, so that when I start getting `line xxxxxxxx does not exist` errors, I can just use `EOF`? – Wolfpack'08 Jan 13 '12 at 12:11