Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Is there a good way to unify text files something like dos2nix shell script(s) do?

by taint (Chaplain)
on Dec 20, 2013 at 05:44 UTC ( #1067918=note: print w/ replies, xml ) Need Help??


in reply to Re: Is there a good way to unify text files something like dos2nix shell script(s) do?
in thread Is there a good way to unify text files something like dos2nix shell script(s) do?

Thanks for the reply, 2teez.

I'm also on a *NIX box (FreeBSD). It looks like I may not have used the best word to describe my ultimate goal (unify). What my ultimate goal is. Is to parse files recursively, and based on their format (iso-*-*, line endings, perhaps trailing spaces) unify them, in the sense that they are all the same in those respects. Ultimately (for me) utf-8, *NIX line endings, with no trailing spaces. I don't have a lot of difficulty making the conversions, so much as I have "tasting" the file before hand. So as to convert it w/o buggering it up. For example, a file in a different (spoken) language that isn't already utf-8. Knowing in advance, what it is, and converting it to utf-8 can be tricky. Even tho I know Perl is pretty good at it.

I'm still searching, and while I haven't found a complete solution. I did find a couple of interesting Text::Filter Modules that may help in cobbling something up. In fact, their pretty nice general purpose Filters for a lot of things: Text::Filter, and Text::Filter::Chain. If I don't use them for this project. I can sure think of a lot of other things to use tham with. :)

Thanks again, 2teez, for the reply.

--Chris

Yes. What say about me, is true.


Comment on Re^2: Is there a good way to unify text files something like dos2nix shell script(s) do?
Re^3: Is there a good way to unify text files something like dos2nix shell script(s) do?
by Anonymous Monk on Dec 20, 2013 at 13:12 UTC
    "It looks like I may not have used the best word to describe my ultimate goal". No surprises there then.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2015-07-03 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls