Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 musing on the Monastery: (12)
As of 2014-07-25 15:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (172 votes), past polls