Sponsored Content
Top Forums Shell Programming and Scripting How to parse a text file with \034 as field and \035 as end of message delimiter? Post 82055 by futurelet on Friday 26th of August 2005 09:20:03 PM
Old 08-26-2005
Use Awk:

Code:
BEGIN { FS="\034"; RS="\035"; OFS="," }
{ gsub( /\n/, "" )
  $1=$1
  # If last field is empty, remove it.
  if ( ""==$NF )  NF--
  print
}

This User Gave Thanks to futurelet For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

delete a field along with delimiter in the whole file

I have file with 20 fields and its pipe delimiter. I need to remove the 18th field along with pipe delimiter that seperates 17th and 18th field. In turn that means i want to make it now a file with only 19 fields. Can some body let me know how ican remove the 18th field from the whole file? (5 Replies)
Discussion started by: dsravan
5 Replies

2. Shell Programming and Scripting

append some text message at the end of the file

Hi All, Please tell me how to append some text message at the end of the file. "File too large to view" example: xyz.log contains hhhhhhhhhhh hhhhhhjjjjjjjjj jjjjjjjjjjjjjjjjjjjjjj "File too large to view" Please advice (3 Replies)
Discussion started by: rajeshorpu
3 Replies

3. Shell Programming and Scripting

Help w/ script to read file and parse log message

Hi, I am working on the script to parsing the specific message like "aaaa" in multiple log files like N1-***,N2-***,N3-***... The script is to find the list of lof files which contains the message "aaaa" and export the list into excel filE. Can anyone give help? Thanks (2 Replies)
Discussion started by: shyork2001
2 Replies

4. Shell Programming and Scripting

xmlstarlet parse field from file

I have a xmlfile like this: <?xml version="1.0" encoding="utf-8"?> <contentlocation xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns="http://wherein.yahooapis.com/v1/schema" xml:lang="en"> <processingTime>0.001538</processingTime> ... (1 Reply)
Discussion started by: unclecameron
1 Replies

5. Shell Programming and Scripting

Appending a new field at the end in a file

can anyone tell me please ......how to append a new field at the end of a file with the help of sed or some other command in bourne shell (8 Replies)
Discussion started by: amitpta
8 Replies

6. Shell Programming and Scripting

how to find the nth field value in delimiter file in unix using awk

Hi All, I wanted to find 200th field value in delimiter file using awk.? awk '{print $200}' inputfile I am getting error message :- awk: The field 200 must be in the range 0 to 199. The source line number is 1. The error context is {print >>> $200 <<< } using... (4 Replies)
Discussion started by: Jairaj
4 Replies

7. Shell Programming and Scripting

Shell script to put delimiter for a no delimiter variable length text file

Hi, I have a No Delimiter variable length text file with following schema - Column Name Data length Firstname 5 Lastname 5 age 3 phoneno1 10 phoneno2 10 phoneno3 10 sample data - ... (16 Replies)
Discussion started by: Gaurav Martha
16 Replies

8. Shell Programming and Scripting

Replacing entire fields with specific text at end or beginning of field

Greetings. I've got a csv file with data along these lines: Spumoni's Pizza Place, Placemats n Things, Just Lamps Counterfeit Dollars by Vinnie, Just Shades, Dollar StoreI want to replace the entire comma-delimited field if it matches something ending in "Place" or beginning with "Dollar",... (2 Replies)
Discussion started by: palmfrond
2 Replies

9. Shell Programming and Scripting

awk to parse field and include the text of 1 pipe in field 4

I am trying to parse the input in awk to include the |gc= in $4 but am not able to. The below is close: awk so far: awk '{sub(/\|]+]++/, ""); print }' input.txt Input chr1 955543 955763 AGRN-6|pr=2|gc=75 0 + chr1 957571 957852 AGRN-7|pr=3|gc=61.2 0 + chr1 970621 ... (7 Replies)
Discussion started by: cmccabe
7 Replies

10. Shell Programming and Scripting

How can awk ignore the field delimiter like comma inside a field?

We have a csv file as mentioned below and the requirement is to change the date format in file as mentioned below. Current file (file.csv) ---------------------- empname,date_of_join,dept,date_of_resignation ram,08/09/2015,sales,21/06/2016 "akash,sahu",08/10/2015,IT,21/07/2016 ... (6 Replies)
Discussion started by: gopal.biswal
6 Replies
anno(1) 						      General Commands Manual							   anno(1)

NAME
anno - annotate messages (only available within the message handling system, mh) SYNOPSIS
anno [+folder] [msgs] [-component field] [-help] [-[no]inplace] [-text body] OPTIONS
Specifies the name of the header field which anno adds. It should be a valid RFC 822-style message field name, which means that it should consist of alphanumeric characters or dashes only. If you do not supply this option, anno will prompt you for the field name. Prints a list of the valid options to this command. The -inplace switch causes annotation to be done in place in order to preserve links to the annotated message. Allows you to add a header field containing text to the message. The anno command will create a second header field on the message, containing the text that you specify. If the text contains a space, you must enclose the text in double quotes ("). If you do not supply this option, anno adds only one field, which contains the date of the annotation. The default settings for this command are: +folder defaults to the current folder msgs defaults to the current message -noinplace DESCRIPTION
The anno command annotates a message by adding one or more header fields to the message. The anno command allows you to choose the name of the header field which you add. It records the date at which the message is annotated, and allows you to add an additional field containing text, if you wish. You can use anno with dist, forw, and repl, to keep track of how you have distributed, forwarded, or replied to messages. By default, anno annotates the current message in the current folder. You can select another message by using the msg and +folder argu- ments. You can also annotate more than one message, or a range of messages. PROFILE COMPONENTS
Path: To determine your Mail directory EXAMPLES
This example annotates message number 1 in the folder +test. The -component option specifies the name of the header field: % anno 1 +test -component Forwarded The following field is added to the message header: Forwarded: Tue, 08 Jan 1991 16:10:06 +0000 The next example shows how to use the -text option to add an additional field: % anno -component Forwarded -text "to David - as requested" The following lines are added to the message header: Forwarded: Tue, 08 Jan 1991 16:13:27 +0000 Forwarded: to David - as requested The final example shows how anno prompts for the name of the header field, if the -component option is not supplied: % annoEnter component name: forwarded The following line is added to the message: forwarded: Tue, 08 Jan 1991 16:21:58 +0000 FILES
The user profile. SEE ALSO
dist(1), forw(1), repl(1) anno(1)
All times are GMT -4. The time now is 06:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy