Sponsored Content
Top Forums Shell Programming and Scripting Split file by column value, each with header Post 302985786 by RudiC on Tuesday 15th of November 2016 08:44:58 AM
Old 11-15-2016
The output is redirected to the respective file, controlled by $5, as requested in post#1. If a new (i.e. not yet registered) $5 shows up in a line, the new file name is constructed in FN[$5], and then, all lines with the same $5 are assembled in the same file. The number of files (= different unique $5) is "unlimited" (except for system factors e.g. memory).
These 3 Users Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split large file and add header and footer to each file

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (1 Reply)
Discussion started by: ashish4422
1 Replies

2. Shell Programming and Scripting

Split large file and add header and footer to each small files

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (7 Replies)
Discussion started by: ashish4422
7 Replies

3. UNIX for Dummies Questions & Answers

split header row into one column

So, I have a massive file with thousands of columns I want a list of the headers in one column in another file. So I need to strip off the top line (can use head-1) But how can I convert from this format: A B C D E F G to A B C D E F G (6 Replies)
Discussion started by: polly_falconer
6 Replies

4. Shell Programming and Scripting

Rename a header column by adding another column entry to the header column name URGENT!!

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (4 Replies)
Discussion started by: Vavad
4 Replies

5. UNIX for Dummies Questions & Answers

Rename a header column by adding another column entry to the header column name

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (1 Reply)
Discussion started by: Vavad
1 Replies

6. UNIX for Dummies Questions & Answers

Column Header in the Spool file

Hi All, I have a problem with the column heading while spooling the data from the database. Since i want the column header, therefore i am not using SET HEADING OFF, and i am getting the header, but for the longer column name, some of the character from the column name is missing. for... (7 Replies)
Discussion started by: Pramod_009
7 Replies

7. Shell Programming and Scripting

Split and add header and trailer from input file

I need to split the file based on pattern from position 34-37 while retaining the header and trailer records in each individual split file Also is it possible to output the TOM and PAT records in the same output file ? I need the output file names same as xyz_pattern_Datetimestamp.txt ... (23 Replies)
Discussion started by: techedipro
23 Replies

8. Shell Programming and Scripting

Sort and Split file with header and custom name

Hi, I am using SUN SOLARIS (SunOS sun4v sparc SUNW, T5240). I have a huge data file with header and trailer. This file gets used into an ETL process. ETL skips the header record (which is the first record of the file) and loads the rest of the record. The file can be delimited (comma,... (5 Replies)
Discussion started by: Saanvi1
5 Replies

9. Shell Programming and Scripting

Split a file based on encountering header

I need to split a file based on headers found Input file file1 content: ADD john mickey DROP matt sam output of file F1 john mickey output of file F2 matt sam (5 Replies)
Discussion started by: Diddy
5 Replies

10. Shell Programming and Scripting

Split large xml into mutiple files and with header and footer in file

Split large xml into mutiple files and with header and footer in file tried below it splits unevenly and also i need help in adding header and footer command : csplit -s -k -f my_XML_split.xml extrfile.xml "/<Document>/" {1} sample xml <?xml version="1.0" encoding="UTF-8"?><Recipient>... (36 Replies)
Discussion started by: karthik
36 Replies
MH-MAIL(5)                                                           [nmh-1.5]                                                          MH-MAIL(5)

NAME
mh-mail - message format for nmh message system SYNOPSIS
any nmh command DESCRIPTION
nmh processes messages in a particular format. It should be noted that although neither Bell nor Berkeley mailers produce message files in the format that nmh prefers, nmh can read message files in that antiquated format. Each user possesses a mail drop box which initially receives all messages processed by post. Inc will read from that drop box and incorpo- rate the new messages found there into the user's own mail folders (typically "+inbox"). The mail drop box consists of one or more mes- sages. Messages are expected to consist of lines of text. Graphics and binary data are not handled. No data compression is accepted. All text is clear ASCII 7-bit data. The general "memo" framework of RFC-822 is used. A message consists of a block of information in a rigid format, followed by general text with no specified format. The rigidly formatted first part of a message is called the header, and the free-format portion is called the body. The header must always exist, but the body is optional. These parts are separated by an empty line, i.e., two consecutive newline characters. Within nmh , the header and body may be separated by a line consisting of dashes: From: Local Mailbox <user@example.com> To: cc: Fcc: +outbox Subject: The header is composed of one or more header items. Each header item can be viewed as a single logical line of ASCII characters. If the text of a header item extends across several real lines, the continuation lines are indicated by leading spaces or tabs. Each header item is called a component and is composed of a keyword or name, along with associated text. The keyword begins at the left margin, may NOT contain spaces or tabs, may not exceed 63 characters (as specified by RFC-822), and is terminated by a colon (`:'). Cer- tain components (as identified by their keywords) must follow rigidly defined formats in their text portions. The text for most formatted components (e.g., "Date:" and "Message-Id:") is produced automatically. The only ones entered by the user are address fields such as "To:", "cc:", etc. Internet addresses are assigned mailbox names and host computer specifications. The rough for- mat is "local@domain", such as "MH@UCI", or "MH@UCI-ICSA.ARPA". Multiple addresses are separated by commas. A missing host/domain is assumed to be the local host/domain. As mentioned above, a blank line (or a line of dashes) signals that all following text up to the end of the file is the body. No format- ting is expected or enforced within the body. Following is a list of header components that are considered meaningful to various nmh programs. Date: Added by post, contains date and time of the message's entry into the mail transport system. From: This header is filled in by default with the system's idea of the user's local mailbox. This can be changed with the Local-Mailbox profile entry. It contains the address of the author or authors (may be more than one if a "Sender:" field is present). For a stan- dard reply (using repl), the reply address is constructed by checking the following headers (in this order): "Mail-Reply-To:", "Reply-To:", "From:", "Sender:". A "From:" header MUST exist when the message is sent to post, otherwise the message will be rejected. Mail-Reply-To: For a standard reply (using repl), the reply address is constructed by checking the following headers (in this order): "Mail- Reply-To:", "Reply-To:", "From:", "Sender:". Mail-Followup-To: When making a "group" reply (using repl -group), any addresses in this field will take precedence, and no other reply address will be added to the draft. If this header is not available, then the return addresses will be constructed from the "Mail-Reply-To:", or "Reply-To:", or "From:", along with adding the addresses from the headers "To:", "cc:", as well as adding your personal address. Reply-To: For a standard reply (using repl), the reply address is constructed by checking the following headers (in this order): "Mail- Reply-To:", "Reply-To:", "From:", "Sender:". Sender: Required by post in the event that the message has multiple addresses on the "From:" line. It is otherwise optional. This line should contain the address of the actual sender. To: Contains addresses of primary recipients. cc: Contains addresses of secondary recipients. Bcc: Still more recipients. However, the "Bcc:" line is not copied onto the message as delivered, so these recipients are not listed. nmh uses an encapsulation method for blind copies, see send(1). Dcc: Still more recipients. However, the "Dcc:" line is not copied onto the messages as delivered. Recipients on the "Dcc:" line receive the same messsage as recipients on the "To:" and "cc:" lines. See send(1) for more details. Fcc: Causes post to copy the message into the specified folder for the sender, if the message was successfully given to the transport sys- tem. Message-ID: A unique message identifier added by post if the -msgid flag is set. Subject: Sender's commentary. It is displayed by scan. In-Reply-To: A commentary line added by repl when replying to a message. Resent-Date: Added when redistributing a message by post. Resent-From: Added when redistributing a message by post. Resent-To: New recipients for a message resent by dist. Resent-cc: Still more recipients. See "cc:" and "Resent-To:". Resent-Bcc: Even more recipients. See "Bcc:" and "Resent-To:". Resent-Fcc: Copy resent message into a folder. See "Fcc:" and "Resent-To:". Resent-Message-Id: A unique identifier glued on by post if the -msgid flag is set. See "Message-Id:" and "Resent-To:". Resent: Annotation for dist under the -annotate option. Forwarded: Annotation for forw under the -annotate option. Replied: Annotation for repl under the -annotate option. FILES
/var/mail/$USER Location of mail drop SEE ALSO
Standard for the Format of ARPA Internet Text Messages (RFC-822) CONTEXT
None MH.6.8 11 June 2012 MH-MAIL(5)
All times are GMT -4. The time now is 07:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy