CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
concatenate files in terminal



Jul 22, 2016, 7:28 PM

Post #1 of 2 (1718 views)
concatenate files in terminal Can't Post

Hi all,

This problem may be solved by using linux terminal directly, but I don't know where to post it. There are many txt files in a directory, file.1.txt, file.2.txt, file.3.txt, until file.200.txt. Each file has one line of contents, just numbers. How to combine the files together into one file, so that the resulting file has many lines, from line 1 to line 200. I don't know how to concatenate the files in order. Thanks for your help.

Veteran / Moderator

Jul 23, 2016, 12:39 AM

Post #2 of 2 (1701 views)
Re: [rockcone01] concatenate files in terminal [In reply to] Can't Post

First open an output file, then read each single input file in turn and print out the input lines into the output file. Close the files.

You don't give much detail (for example on how to identify the input files that need to be processed), so I can't give you much more detail on how to do it.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives