Please become accustomed to provide decent context info of your problem.
It is always helpful to support a request with system info like OS and shell, related environment (variables, options), preferred tools, and adequate (representative) sample input and desired output data and the elaborate (!) logics connecting the two, to avoid ambiguities and keep people from guessing.
for example:
searches only for single word
for single word
this is line three
match=$(grep -n -e "single" data.txt)
this command will stored "..... single ...... single" into search.
how can i grep the single word just from line 2 only?? (3 Replies)
ok, so this is proving to be kind of difficult even though it should not be.
say for instance I want to grep out ONLY the word fkafal from the below output, how do I do it?
echo ajfjf fjfjf iafjga fkafal foeref afoafahfia | grep -w "fkafal"
If i run the above command, i get back all the... (4 Replies)
Hi.
I have a tab separated file that has a couple nearly identical lines. When doing:
sort file | uniq > file.new
It passes through the nearly identical lines because, well, they still are unique.
a)
I want to look only at field x for uniqueness and if the content in field x is the... (1 Reply)
Hi,
I have gone through may posts and dint find exact solution for my requirement.
I have file which consists below data and same file have lot of other data.
<MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'>
<MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Is it possible to modify file like this.
1. Remove all the duplicate names in a define column i.e 4th col
2. Count the no.of unique names separated by ";" and print as a 5th col
thanx in advance!!
Q
input
c1 30 3 Eh2
c10 96 3 Frp
c41 396 3 Ua5;Lop;Kol;Kol
c62 2 30 Fmp;Fmp;Fmp
... (5 Replies)
Hi,
Below is an example :
ST1 PREF: int1 AVAIL: int2
ST2 PREF :int1 AVAIL: int2
I need int1 to come in preferred variable while programming and int2 in available variable
Please help me doing so
Best regards,
Vishal (10 Replies)
Trying to use awk to find a keyword and return the matches in the row, but also $1 and $2, which are the unique id's, but they only appear once. Thank you :).
file
name 31 Index Chromosomal Position Gene Inheritance
122 2106725 TSC2 AD
124 2115481 TSC2 AD
121 2105400 TSC2 AD... (6 Replies)
Hello All,
Here is am trying to get maximum value of third field depending on
first,second and fourth fields with awk command . delimeter is pipe(|) .
input
0221|09|14.25|aaa
0221|09|44.27|aaa
0221|09|44.33|aaa
0221|09|44.53|bbb
0221|09|34.32|bbb
0221|09|37.13|bbb... (5 Replies)
Discussion started by: sayami00
5 Replies
LEARN ABOUT DEBIAN
dpkg-awk
DPKG-AWK(1) General Commands Manual DPKG-AWK(1)NAME
dpkg-awk - Utility to read a dpkg style db file
SYNOPSIS
dpkg-awk [(-f|--file) filename] [(-d|--debug) ##] [(-s|--sort) list] [(-rs|--rec_sep) ??] '<fieldname>:<regex>' ... -- <out_fieldname> ..
DESCRIPTION
dpkg-awk Parses a dpkg status file (or other similarly formatted file) and outputs the resulting records. It can use regex on the field
values to limit the returned records, it can also be told which fields to output, and it can sort the matched fields.
OPTIONS -f filename
--file filename
The file to parse. The default is /var/lib/dpkg/status.
-d [#]
--debug [#]
Each time this is specified, it increased the debug level.
-s field(s)
--sort field(s)
A space or comma separated list of fields to sort on.
-n field(s)
--numeric field(s)
A space or comma separated list of fields that should be interpreted as numeric in value.
-rs ??
--rec_sep ??
Output this string at the end of each output paragraph.
-h
--help Display some help.
fieldname
The fields from the file, that are matched with the regex given. The fieldnames are case insensitive.
out_fieldname
The fields from the file, that are output for each record. If the first field listed begins with ^, then the list of fields that
follows will NOT be output.
BUGS
Be warned that the author has only a shallow understanding of the dpkg packaging system, so there are probably tons of bugs in this pro-
gram.
This program comes with no warranties. If running this program causes fire and brimstone to rain down upon the earth, you will be on your
own.
This program accesses the dpkg database directly in places, querying for data that cannot be gotten via dpkg.
AUTHOR
Adam Heath <doogie@debian.org>
DEBIAN Debian Utilities DPKG-AWK(1)