Below an example of what I mean. The first attempt does what I want; the second doesn't, because bash assumes a line break means the end of an individual "command unix". Is there some way that I can convince bash to parse out, eg, to the closing parenthesis?
I'm thinking this would allow for... (1 Reply)
I have several huge files wich contains oracle table creation scripts as follows:
I would need to remove the pattern colored in red above. Any sed/awk/pearl code will be of much help.
Thanks (2 Replies)
Hi All,
I have named a file with current date,time and year as follows:
month=`date | awk '{print $2}'`
date=`date | awk '{print $3}'`
year=`date | awk '{print $6}'`
time=`date +%Hh_%Mm_%Ss'`
filename="test_"$month"_"$date"_"$year"_"$time".txt"
> $filename
The file is created with a... (2 Replies)
Hi All,
We append the output of a file's size in a file. But a newline character is appended after the variable.
Pls help how to clear this.
filesize=`ls -l test.txt | awk `{print $5}'`
echo File size of test.txt is $filesize bytes >> logfile.txt
The output we got is,
File size of... (4 Replies)
Hi All,
I have 5000 records like this
Request_id|Type|Status|Priority|Ticket Submitted Date and Time|Actual Resolved Date and Time|Current Ticket Owner Group|Case final Ticket Owner Group|Customer Severity|Reported Symptom/Request|Component|Hot Topic|Reason for Missed SLA|Current Ticket... (2 Replies)
Hello all,
first off great forum.
Now for my little problem.
Using RHEL 5.4 and awk. Been doing code since a few month. So just starting.
My problem is handeling data on multiple lines.
{
if ($1 != LASTKEY && h ~ /.*\/s_fr_/) {
checkgecos( h, h )
h=""
... (2 Replies)
Hi,
In my file, I have '\n' characters inside a single record. Because of this, a single records appears in many lines and looks like multiple records. In the below file.
File 1
====
1,nmae,lctn,da\n
t
2,ghjik,o\n
ut,de\n
fk
Expected output after the \n removed
File 2
=====... (5 Replies)
hi i am having delimited .dat file having content like below.
test.dat(5 line of records)
======
PT2~Stag~Pt2 Stag Test.
Updated~PT2 S T~Area~~UNCEF R20~~2012-05-24 ~2014-05-24~~
PT2~Stag y~Pt2 Stag Test.
Updated~PT2 S T~Area~METR~~~2012-05-24~2014-05-24~~test
PT2~Pt2 Stag Test~~PT2 S... (4 Replies)
Hi all..
I have a text file which looks like below:
abcd
efgh
ijkl
(blank space)
I need to remove only the last (blank space) from the file. When I try wc -l the file name,the number of lines coming is 3 only, however blank space is there in the file.
I have tried options like... (14 Replies)
I have a file which comes every day and the file data look's as below.
Vi abc.txt
a|b|c|d\n
a|g|h|j\n
Some times we receive the file with only a new line character in the file like
vi abc.txt
\n (8 Replies)
Discussion started by: rak Kundra
8 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)