Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: File end marker problem

by robartes (Priest)
on Apr 01, 2003 at 12:05 UTC ( [id://247216]=note: print w/replies, xml ) Need Help??


in reply to File end marker problem

Try this:
perl -ne 'print unless /\x1a/;' concatfile >x.txt

Update: This only works if the \x1a is on a line by itself. If not, try this:

perl -npe 's/\x1a//;' concatfile >x.txt
This is however virtually the same thing as yours. It works for me on a file with random \x1a scattered throughout it (as does your code if I drop the binmode. If you're on Unix, you don't need it, and you would need to put it after the open of concatfile for it to work as well).

CU
Robartes-

Replies are listed 'Best First'.
Re: Re: File end marker problem
by zby (Vicar) on Apr 01, 2003 at 12:12 UTC
    He did not say the marker is on a separate line.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://247216]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-25 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found