Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Combining files

by Win (Novice)
on Oct 02, 2009 at 11:02 UTC ( [id://798822]=perlquestion: print w/replies, xml ) Need Help??

Win has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Combining files
by Utilitarian (Vicar) on Oct 02, 2009 at 11:19 UTC
    This is a basic OS task, even Dos can do it
    c:\DoS> type * >..\newFile
    A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Combining files
by desemondo (Hermit) on Oct 02, 2009 at 11:34 UTC
    Actually, you might not even need Perl for that one.

    To "join" some files (appended one after another) try the following:
    copy test1.txt +test2.txt +test3.txt test_appended.txt

    More info copy /?
    ... To append files, specify a single file for destination, but multip +le files for source (using wildcards or file1+file2+file3 format).


    Update: Utilitarian's way would work too - however it might be a tad slower... (unlikey to make any real difference though)
Re: Combining files
by marto (Cardinal) on Oct 02, 2009 at 11:13 UTC

    Given your recent comment one one liners is this wise? What have you tried so far? Your options are learn how to do this using your OS, or learn how to do it using Perl. As previously stated this site isn't rentacoder.com. All of the resources you need have been pointed out to you, many times.

Re: Combining files
by Anonymous Monk on Oct 02, 2009 at 11:11 UTC
    I am operating in a Windoze environment.

    Install cat program, they have for windows

Re: Combining files
by planetscape (Chancellor) on Oct 02, 2009 at 13:09 UTC
Re: Combining files
by Anonymous Monk on Oct 02, 2009 at 11:15 UTC
Re: Combining files
by Not_a_Number (Prior) on Oct 02, 2009 at 18:53 UTC

    Well done everybody!

    Our friend has got his reply (in fact, several replies that work), and he'll be happy: he didn't have to do any of the things he never bothers to (such as reading docs or googling..).

    OK, he reaped a few insults along the way, and lost more XP, but he doesn't care. You've once again allowed yourselves to be manipulated by him {sigh!} and served him up his answer on a platter!

      Actually, I sometimes enjoy this kind of thread, as even a do-my-homework question might unintentionally touch on a few interesting points within Perl.And if a thread happens to wander in that direction, it suddenly might show a few gems and interesting viewpoints from other monks. Sometimes an obvious, too-simple, naive or absurd opening question is required for this (zen) event to happen.

      Kind of thread-hijacking. But I think the opening monk has to allow for hijacking when asking this kind of question. The potential for such gems (and me learning something interesting) IMHO more than outweighs both the harm to the community by a potential homework-troll and the harm to the potential homework-trolls skill level. Kind of an evil point of view :)

      This time it was not so much learning but really fun to find out about a module successor to that unix tool rewrite in perl project (PPT, was it?). And that DOS copy + trick might prove useful to me one day.

      Paraphrase: I care about us and knowledge, but not necessarily about the opener.

      cu Peter

      PS: Just stumbled upon Stupid stumpers and good questions from just before I joined. This thread raises similar points and also reflects on hidden gems inspite of or rather due to a monk's annyoance about openers and answers. What's that saying: On the Internet, it's always September. And September ended last week.

      PS2: Stumbled on fellow monk audreyt's troll hugging report (probably best described as unsuspecting troll meats border collie - nice :))

Re: Combining files
by ikegami (Patriarch) on Oct 02, 2009 at 14:49 UTC
Re: Combining files
by BrowserUk (Patriarch) on Oct 03, 2009 at 00:14 UTC

    Why do you want to do this? Will you ever want to separate them?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Not sure what Win's task is, but in my case, Due to a system upgrade at work, our log files got cut twice a day instead of once.
      Using the appending feature of copy was literally a 2 second fix to make the report look the same...

        Which is great if the only files in the directory are the two halves of the log file. But I'd still use

        copy log1+log2 log

        The thing that has me intrigued is Wins

        combine all files in a folder, stacked one on top of another in a single file?

        Especially if there is any possibility of any binary files in that folder.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-19 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found