Sponsored Content
Full Discussion: Gawk field separator problem
Top Forums Shell Programming and Scripting Gawk field separator problem Post 302663623 by KomjongShawn on Thursday 28th of June 2012 10:04:16 AM
Old 06-28-2012
Thanks. All of your suggestions worked (and saved me a lot of headache).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem in getting the ps information with field separator

Dear all I have the following problem that want to have your advices. I want to capture the `ps auxwww | head -30` image with field separator (|) in my script My expect output USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND root | 774 | 18.5 | 0.0 | 12 | 19716 | - |... (5 Replies)
Discussion started by: on9west
5 Replies

2. Shell Programming and Scripting

field separator in Perl

is there a similar parameter you can set in perl like FS in awk? I think I've read all the tutorials on the subject, but cannot get this map split and so on thing to work. I need to sort a file by columns, eg. first, third, fifth... The script I need to add this column sorting is this: use... (38 Replies)
Discussion started by: ahsog
38 Replies

3. Shell Programming and Scripting

awk, comma as field separator and text inside double quotes as a field.

Hi, all I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes. sample input: for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Discussion started by: kevintse
8 Replies

4. Shell Programming and Scripting

Field separator X'1F'

Hi, I have a flat file with fields separated by a X'1F' i have to fetch 4th field from second line. please help me how to achieve it. I tried with below command and its not working. cut -f4 -d`echo -e '\x1f'` filename.txt I am using SunOS. Thanks in advance. (2 Replies)
Discussion started by: rohan10k
2 Replies

5. Shell Programming and Scripting

echo field separator

I am trying to echo all fields except for the last field. I want to include the field seperator, but it is removed. echo "a;s;v;g" | awk -F ";" '{$(NF--)=""; print}' a s v I want an output like this: a;s;v; (3 Replies)
Discussion started by: locoroco
3 Replies

6. UNIX for Dummies Questions & Answers

change field separator only from nth field until NF

Hi ! input: 111|222|333|aaa|bbb|ccc 999|888|777|nnn|kkk 444|666|555|eee|ttt|ooo|ppp With awk, I am trying to change the FS "|" to "; " only from the 4th field until the end (the number of fields vary between records). In order to get: 111|222|333|aaa; bbb; ccc 999|888|777|nnn; kkk... (1 Reply)
Discussion started by: beca123456
1 Replies

7. Shell Programming and Scripting

awk field separator

I need to set awk field separator to ";", but I need to avoid ";EXT". so that echo a;b;c;EXTd;e;f | awk -F";" '{print $3}' would give "c;EXTd" (2 Replies)
Discussion started by: locoroco
2 Replies

8. Shell Programming and Scripting

awk field separator help -

Hi Experts , file : - How to construct the awk filed separator so that $1, $2 $3 , can be assigned to the each "" range. I am trying : awk -F"]" '{print $1}' but it is printing the entire file. Not first field. The desired output needed for first field... (9 Replies)
Discussion started by: rveri
9 Replies

9. Shell Programming and Scripting

Field separator

Hello All, I have a file, but I want to separate the file at a particular record with comma"," in the line Input file APPLE6SSAMSUNGS5PRICEPERPIECEDOLLAR600EACH010020340URX581949695US to Output file APPLE6S,SAMSUNGS5,PRICEPERPIECE,DOLLAR600EACH,010020340URX581949695,US This is for... (11 Replies)
Discussion started by: m6248m
11 Replies

10. Shell Programming and Scripting

Inserting a field without disturbing field separator on other fields

Hi All, I have the input as below: cat input 032016002 2.891 97.109 16.605 27.172 24.017 32.207 0.233 0.021 39.810 0.077 0.026 19.644 13.882 0.131 11.646 0.102 11.449 76.265 23.735 16.991 83.009 8.840 91.160 0.020 99.980 52.102 47.898 44.004 55.996 39.963 18.625 0.121 1.126 40.189... (15 Replies)
Discussion started by: am24
15 Replies
HEADACHE(1)							  [FIXME: manual]						       HEADACHE(1)

NAME
headache - A program to manage the license of your source file. SYNOPSIS
headache [-h file] [-c file] [-r] [-help | --help] file... DESCRIPTION
This manual page documents briefly the headache command. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. It is a common usage to put at the beginning of source code files a short header giving, for instance, some copyright information. headache is a simple and lightweight tool for managing easily these headers. Among its functionalities, one may mention: o Headers must generally be generated as comments in source code files. headache deals with different files types and generates for each of them headers in an appropriate format. o Headers automatically detects existing headers and removes them. Thus, you can use it to update headers in a set of files. COMMAND LINE OPTIONS
file Name of one file to process -h file Create a header with text coming from file -c file Read the given configuration file -help, --help Display the option list of headache USAGE
Let us illustrate the use of this tool with a small example. Assume you have a small project mixing C and Caml code consisting in three files 'foo.c', 'bar.ml' and 'bar.mli'', and you want to equip them with some header. First of all, write a header file, i.e. a plain text file including the information headers must mention. An example of such a file is given in figure 1. In the following, we assume this file is named 'myheader' and is in the same directory as source files. Then, in order to generate headers, just run the command : headache -h myheader foo.c bar.ml bar.mli Each file is equipped with an header including the text given in the header file 'myheader', surrounded by some extra characters depending on its format making it a comment (e.g. '(*' and '*)' in '.ml' files). If you update the header file 'myheader', you simply need to re-run the above command to update headers in source code files. Similarly, running : headache -r foo.c bar.ml bar.mli removes any existing in files 'foo.c', 'bar.ml' and 'bar.mli'. Files which do not have a header are kept unchanged. CONFIGURATION FILE
File types and format of header may be specified by a configuration file. By default, the default builtin configuration file given in figure 2 is used. You can also use your own configuration file thanks to the -c option : headache -c myconfig -h myheader foo.c bar.ml bar.mli In order to write your own configuration, you can follow the example given in figure 2. A configuration file consists in a list of entries separated by the character '|'. Each of them is made of two parts separated by an '->'. The first one is a regular expression. (Regular expression are enclosed within double quotes and have the same syntax as in Gnu Emacs.) headache determines file types according to file basenames; thus, each file is dealt with using the first line its name matches. The second one describes the format of headers for files of this type. It consists of the name of a model (e.g. 'frame'), possibly followed by a list of arguments. Arguments are named: 'open:"(*"' means that the value of the argument 'open' is '(*'. headache currently supports three models and a special keyword: frame With this model, headers are generated in a frame. This model requires three arguments: 'open' and 'close' (the opening and closing sequences for comments) and 'line' (the character used to make the horizontal lines of the frame). Two optional arguments may be used 'margin' (a string printed between the left and right side of the frame and the border, by default two spaces) and 'width' (the width of the inside of the frame, default is 68). lines Headers are typeset between two lines. Three arguments must be provided: 'open' and 'close' (the opening and closing sequences for comments), 'line' (the character used to make the horizontal lines). Three optional arguments are allowed: 'begin' (a string typeset at the beginning of each line, by default two spaces), 'last' (a string typeset at the beginning of the last line) and 'width' (the width of the lines, default is 70). no This model generates no header and has no argument. skip Skip line corresponding to one of the "match" parameters regexp. For this kind of line, every first part pattern that matches the file basename is taken into account. SEE ALSO
/usr/share/doc/headache/manual.html AUTHOR
This manual page was written by Sylvain Le Gall gildor@debian.org Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Lesser General Public License, Version 2.1 or any later version published by the Free Software Foundation; considering as source code all the file that enable the production of this manpage. AUTHOR
Sylvain Le Gall <gildor@debian.org> Author. COPYRIGHT
Copyright (C) 2003, 2004, 2005, 2006 Sylvain Le Gall [FIXME: source] Feb 15, 2004 HEADACHE(1)
All times are GMT -4. The time now is 03:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy