Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

splitting files that has special characters in it

Status
Not open for further replies.

zaq67

Programmer
Sep 28, 2000
3
US
Hi:
I have a file that contains thousands of lines that has null pointers in it. When I use sed to splt the file into several files, sed takes out the null pointers. IS there away to keep sed from altering the file. If not, what would you suggest to use instead of sed. the sed command I'm using is like this:
sed '1,5000p' testdata > file1.out. [sig][/sig]
 
For dake of argument, you have a file 1ith 6000 lines. Then the following command

split -1500 testdata outfile

will produce 4 files of 1500 lines named outfile.aa, outfile.ab, outfile.ac, outfile.ad


You could also try this :-
head -1500 testdata > file1.out (lines 0 - 1500)
head -3000 | tail -1500 > file2.out (lines 1501 - 3000) [sig]<p>Ged Jones<br><a href=mailto:gedejones@hotmail.com>gedejones@hotmail.com</a><br><a href= > </a><br>Top man[/sig]
 
Appologies for &quot;dake&quot; (sake) and &quot;1ith&quot; (with) [sig]<p>Ged Jones<br><a href=mailto:gedejones@hotmail.com>gedejones@hotmail.com</a><br><a href= > </a><br>Top man[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top