I've got a file with each record on a separate line and each record contains 34 fields separated by a colon and i'm trying to re-arrange the order of the fields and merge together certain fields separated by a slash (like field7/field28). I tried using an awk print statement like
awk -F: 'BEGIN... (5 Replies)
Hello friends,
I searched in forums for similar threads but what I want is to have a single awk code to perform followings;
I have a big log file going like this;
...
7450494 1724465 -47 003A98B710C0
7450492 1724461 -69 003A98B710C0
7450488 1724459 001DA1915B70 trafo_14:3
7450482... (5 Replies)
Hello,
I couldn't find anything on the Forum that would help me to solve this problem. Could any body help me process below data using awk?
I have got two files:
file1:
Worker1: Thomas
Position: Manager
Department: Sales
Salary: $5,000
Worker2: Jason
Position: ... (5 Replies)
I've been a Unix admin for nearly 30 years and never learned AWK. I've seen several similar posts here, but haven't been able to adapt the answers to my situation. AWK is so damn cryptic! ;)
I have a single file with ~900 lines (CSV list). Each line starts with an ID, but with different stuff... (6 Replies)
Hi,
I have a file (sorted by sort) with 8 tab delimited columns. The first column contains duplicated fields and I need to merge all these identical lines.
My input file:
comp100002 aaa bbb ccc ddd eee fff ggg
comp100003 aba aba aba aba aba aba aba
comp100003 fff fff fff fff fff fff fff... (5 Replies)
Hi All
I have a .dat file, the values are seperated by ". I wish to identify all field values in field 14 that are not '01-APR-2013' band then copy those records to a new file. Can anyone suggest the UNIX command required.
Thanks in advance
Andy (2 Replies)
Running solaris 9, on issuing the follwing command
df -h | awk '$5 > 45 {print}'
Filesystems with utilisation > 45% are being displayed as well as those between
5 and-9%!!! (3 Replies)
Hi all.
This is the content of the text file used for the e-mail:
TM ICP-EDW BILLING REGISTER USAGE BREAKDOWN_01062014.csv
TM_ICP_EDWH_FICL_13062014.TXT
TM_ICP_EDWH_FICL_16062014.TXT
TM_ICP_EDW_Detailed Payment Journal Report_13062014.txt
TM_ICP_EDW_Detailed Payment Journal... (9 Replies)
In the awk below which does execute I get output that is close, except for all the lines that start with a # are removed. Some lines have one others two or three and after the script adds the
ID= to the fields below the pattern in the awk, I can not seem to add the # lines back to the output. ... (5 Replies)
Discussion started by: cmccabe
5 Replies
LEARN ABOUT HPUX
paste
paste(1) General Commands Manual paste(1)NAME
paste - merge same lines of several files or subsequent lines of one file
SYNOPSIS
file1 file2 ...
list file1 file2 ...
list] file1 file2 ...
DESCRIPTION
In the first two forms, concatenates corresponding lines of the given input files file1, file2, etc. It treats each file as a column or
columns in a table and pastes them together horizontally (parallel merging). In other words, it is the horizontal counterpart of cat(1)
which concatenates vertically; i.e., one file after the other. In the option form above, replaces the function of an older command with
the same name by combining subsequent lines of the input file (serial merging). In all cases, lines are glued together with the tab char-
acter, or with characters from an optionally specified list. Output is to standard output, so can be used as the start of a pipe, or as a
filter if is used instead of a file name.
recognizes the following options and command-line arguments:
Without this option, the new-line characters
of all but the last file (or last line in case of the option) are replaced by a tab character. This option allows replac-
ing the tab character by one or more alternate characters (see below).
list One or more characters immediately following replace the default tab as the line concatenation character. The list is
used circularly; i.e., when exhausted, it is reused. In parallel merging (that is, no option), the lines from the last
file are always terminated with a new-line character, not from the list. The list can contain the special escape
sequences: (new-line), (tab), (backslash), and (empty string, not a null character). Quoting may be necessary if charac-
ters have special meaning to the shell. (For example, to get one backslash, use ).
Merge subsequent lines rather than one from each input file.
Use tab for concatenation, unless a list is specified with the option. Regardless of the list, the very last character of
the file is forced to be a new-line.
Can be used in place of any file name
to read a line from the standard input (there is no prompting).
EXTERNAL INFLUENCES
Environment Variables
determines the locale for the interpretation of text as single- and/or multi-byte characters.
determines the language in which messages are displayed.
If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty
variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of
If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See
environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
These commands return the following values upon completion:
Completed successfully.
An error occurred.
EXAMPLES
List directory in one column:
List directory in four columns
Combine pairs of lines into lines
Notes
works similarly, but creates extra blanks, tabs and new-lines for a nice page layout.
DIAGNOSTICS
Except for the option, no more than - 3 input files can be specified (see limits(5)).
AUTHOR
was developed by OSF and HP.
SEE ALSO cut(1), grep(1), pr(1).
STANDARDS CONFORMANCE paste(1)