Sponsored Content
Top Forums UNIX for Dummies Questions & Answers grep multiple text files in folder into 1 text file? Post 26772 by crazykelso on Friday 23rd of August 2002 07:58:12 AM
Old 08-23-2002
error messages

the error message doesn't meen anything however if there are a lot of files in the folder it can be annoying to get all of those messages

you can get rid of those error messages by sending them to another file.

the command

ls * | xargs cat > all 2> /dev/null

works on my system (Sun,solaris)
it may work on yours also
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find all text files in folder and then copy to a new folder

Hi all, *I use Uwin and Cygwin emulator. I´m trying to search for all text files in the current folder (C/Files) and its sub folders using find -depth -name "*.txt" The above command worked for me, but now I would like to copy all found text files to a new folder (C/Files/Text) with ... (4 Replies)
Discussion started by: cgkmal
4 Replies

2. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

3. Shell Programming and Scripting

Loop through text file > Copy Folder > Edit XML files in bulk?

I have a text file which contains lines in this format - it contains 105 lines in total, but I'm just putting 4 here to keep it short: 58571,east_ppl_ppla_por 58788,east_pcy_hd_por 58704,east_pcy_ga_por 58697,east_pcy_pcybs_por It's called id_key.txt I have a sample folder called... (9 Replies)
Discussion started by: biscuitcreek
9 Replies

4. Shell Programming and Scripting

Need to build Shell Script to search content of a text file into a folder consist several files

Have to read one file say sourcefile containing several words and having another folder containing several files. Now read the first word of Sourcefile & search it into the folder consisting sevral files, and create another file with result. We hhave to pick the filename of the file in which... (3 Replies)
Discussion started by: mukesh.baranwal
3 Replies

5. UNIX for Dummies Questions & Answers

How to grep multiple lines from a text file using another text file?

I would like to use grep to select multiple lines from a text file using a single-column text file. Basically I want to only select lines from the first text file where the second column of the first text file matches the second text file. How do I go about doing that? Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies

6. UNIX for Dummies Questions & Answers

Changing text in multiple files, but with different text for each file

Hello, I have a situation where I want to change a line of text in multiple files, but the problem is that I want to change the text to something unique for each file. For example, let's say I have five files named bob.txt, joe.txt, john.txt, tom.txt, and zach.txt. Each of these files has a... (5 Replies)
Discussion started by: Scatterbrain26
5 Replies

7. Shell Programming and Scripting

Extracting lines from text files in folder based on the numbers in another file

Hello, I have a file ff.txt that looks as follows *ABNA.txt 356 24 36 112 *AC24.txt 457 458 321 2 ABNA.txt and AC24.txt are the files in the folder named foo1. Based on the numbers in the ff.txt file, I want to extract the lines from the corresponding files in the foo1 folder and... (2 Replies)
Discussion started by: mohamad
2 Replies

8. Shell Programming and Scripting

Merge the multiple text files into one file

Hi All, I am trying to merge all the text files into one file using below snippet cat /home/Temp/Test/Log/*.txt >> all.txt But it seems it is not working. I have multiple files like Output_ServerName1.txt, Output_ServreName2.txt I want to merge each file into one single file and... (6 Replies)
Discussion started by: sharsour
6 Replies

9. Shell Programming and Scripting

Split a text file into multiple text files?

I have a text file with entries like 1186 5556 90844 7873 7722 12 7890.6 78.52 6679 3455 9867 1127 5642 ..N so many records like this. I want to split this file into multiple files like cluster1.txt, cluster2.txt, cluster3.txt, ..... clusterN.txt. (4 Replies)
Discussion started by: sammy777
4 Replies

10. Shell Programming and Scripting

How to add a text at the beginning of a text files in a folder?

how to add a text ( surya) at the beginning of a text files (so many) in folder text file: 111111 555555 666666 result: surya 111111 555555 666666 (3 Replies)
Discussion started by: suryanarayana
3 Replies
sortm(1)						      General Commands Manual							  sortm(1)

NAME
sortm - sort messages (only available within the message handling system, mh) SYNOPSIS
sortm [msgs] [+folder] [options] OPTIONS
Specifies the name of the header field to use when making the date comparison. If you have a special field in each message, such as Deliv- ery-Date:, then the -datefield switch can be used to tell sortm which field to examine. If you do not give this option, the default is to use the Date: header field. Prints a list of all the valid options to this command. Displays the general actions that it is taking to place the folder in sorted order. The -noverbose option performs these actions silently. The default is -noverbose. The default settings for this command are: +folder defaults to the current folder msgs defaults to all -datefield date -noverbose DESCRIPTION
The command sortm sorts all the messages in the current folder into chronological order according to the contents of the Date: fields of the messages. By default, sortm sorts all the messages in the current folder. You can select particular messages in the folder by giving a range of mes- sages. You can also sort messages in another folder by specifying the folder name. If sortm encounters a message without a Date: field, or if the message has a Date: field that sortm cannot parse, it attempts to keep the message in the same relative position. However, this does not always work; for instance, if the first message encountered lacks a date which can be parsed, then it will usually be placed at the end of the messages being sorted. When sortm complains about a message which it cannot order, it complains about the message number prior to sorting. PROFILE COMPONENTS
Path: To determine your MH directory EXAMPLES
The following example sorts all the messages in the folder +meetings: % sortm +meetings The next example sorts messages 10-30 in the folder called +test: % sortm +test 10-30 FILES
The user profile. SEE ALSO
folder(1) sortm(1)
All times are GMT -4. The time now is 09:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy