04-16-2009
Extracting text out of specific lines
Hi,
I have a file like
LAHORE 2009-04-16 16:04:19 THU
S5830 FAULT MESSAGE SUPPRESS STATUS
LOC : ASP00
STS : SUPPRESSING CONTINUE
INF : F6201 TRUNK. DATA FAULT REPORT
COMPLETED
LAHORE 2009-04-16 16:04:20 THU
S8400 ISUP SIGNALLING TRACE - NORMAL
ITEM TYPE ASP TRK RTE CALL OPC DPC CIC (PCM/CH)
RTE ALL 007 1980 0600 ICT NAT/H'105f NAT/H'10a4 0604(018/28)
CG_PARTY_NO CD_PARTY_NO ISUP_VERSION
428530559 0427376505F WHITE
---- --- ----------------------------------------------- --------------
MSG DIR DATA TIME
---- --- ----------------------------------------------- --------------
IAM <-- 00 20 01 0a 00 02 0a 08 83 10 40 72 73 56 50 0f [16:04:18.200]
08 01 00 0a 07 83 13 24 58 03 55 09 3d 01 1f 00
REL --> 02 04 02 82 91 1e 02 02 08 00 [16:04:18.920]
RLC <-- 00 [16:04:19.200]
---- --- ----------------------------------------------- --------------
REL_REASON = USER BUSY
COMPLETED
LAHORE 2009-04-16 16:04:20 THU
S8400 ISUP SIGNALLING TRACE - NORMAL
ITEM TYPE ASP TRK RTE CALL OPC DPC CIC (PCM/CH)
RTE ALL 007 2366 0600 ICT NAT/H'105f NAT/H'10a4 0958(029/30)
CG_PARTY_NO CD_PARTY_NO ISUP_VERSION
428711416 0422009120F WHITE
---- --- ----------------------------------------------- --------------
MSG DIR DATA TIME
---- --- ----------------------------------------------- --------------
IAM <-- 00 20 01 0a 00 02 0a 08 81 10 40 22 00 19 02 0f [16:04:17.800]
08 01 00 0a 07 83 13 24 78 11 14 06 3d 01 1f 00
ACM --> 12 14 01 2e 01 00 39 02 2e c0 00 [16:04:18.120]
REL --> 02 00 03 81 81 00 [16:04:19.040]
RLC <-- 00 [16:04:19.400]
---- --- ----------------------------------------------- --------------
REL_REASON = UNALLOC NUMBER
COMPLETED
I want to extract highlighted text and have output like
RTE Call CIC CG_PARTY_NO CD_PARTY_NO Release
600 ICT 0604(018/28) 428530559 0427376505F USER BUSY600 ICT 0958(029/30) 428711416 0422009120F UNALLOC NUMBER
Please help.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear All,
I have to extract a a few lines from a log file and I know the starting String and end string(WHich is same ). Is there any simplere way using sed - awk.
e.g. from the following file
--------------------------------------
Some text
Date: 21 Oct 2008
Text to be extracted... (8 Replies)
Discussion started by: rahulkav
8 Replies
2. Shell Programming and Scripting
I'm extremely new to scripting and linux in general, so please bear with me. The class I'm taking gives virtually no instruction at all, and so I'm trying to learn everything off the web.
Anyway, I'm trying to extract characters that follow after a specific pattern ( '<B><FONT FACE="Arial">' ) but... (3 Replies)
Discussion started by: livos23
3 Replies
3. Shell Programming and Scripting
Hi all! Im trying to extract a portion of text from a file and put it into a new file. I need all the lines between <Placement> and </Placement> including the Placemark lines themselves. Is there a way to extract all instances of these and not just the first one found? I've tried using sed and... (4 Replies)
Discussion started by: Grizzly
4 Replies
4. Shell Programming and Scripting
hi all,
i searched in unix.com and accquired the following commands for extracting specific lines from a file ..
sed -n '16482,16482p' in.sql > out.sql
awk 'NR>=10&&NR<=20' in.sql > out.sql....
these commands are working fine if i give the line numbers as such .. but if i pass a... (2 Replies)
Discussion started by: sais
2 Replies
5. Shell Programming and Scripting
Hello,
i've got this output text:
and i need it to look something like this:
which means that there won't be absolute path of each directory, just it's size and the last word after last '/' in each line, and i also don't need last line '1.7M /tmp'
Looks like there is a simple... (5 Replies)
Discussion started by: krater559
5 Replies
6. Shell Programming and Scripting
Hi,
I have one file, say file 1, that has data like below where 19900107 is the date,
19900107 12 144 129 0.7380047
19900108 12 168 129 0.3149017
19900109 12 192 129 3.2766666E-02
... (3 Replies)
Discussion started by: Wynner
3 Replies
7. Shell Programming and Scripting
I have this input file:
and the desired output is as follows:
Desired Output
This is a sample taken from a huge file. Basically, the script should take the tag (TDK11..1>) add everything that has bukle=A until it sees the blank lines. Then takes the next tag (TDK2222>) adds everything that... (4 Replies)
Discussion started by: Ernst
4 Replies
8. UNIX for Dummies Questions & Answers
I have a table to data which one of the columns include string of text
from within that, I am searching to include few lines but not others
for example I want to to include some combination of word address such as (address.| address? |the address | your address) but not (ip address | email... (17 Replies)
Discussion started by: A-V
17 Replies
9. UNIX for Advanced & Expert Users
Hello,
Is there a quick awk one-liner for this extraction?:
file1
49389 text55
52211 text66
file2
59302 text1
49389 text2
85939 text3
52211 text4
13948 text5
Desired output
49389 text2
52211 text4
Thanks!! (5 Replies)
Discussion started by: palex
5 Replies
10. UNIX for Dummies Questions & Answers
I need help extracting specific lines in a text file. The file looks like this:
POSITION TOTAL-FORCE (eV/Angst)
-----------------------------------------------------------------------------------
1.86126 1.86973 1.86972 ... (14 Replies)
Discussion started by: captainalright
14 Replies
LEARN ABOUT DEBIAN
maphimbu
MAPHIMBU(1) User Commands MAPHIMBU(1)
NAME
maphimbu - histogram builder for 1-d numerical and text data
SYNOPSIS
maphimbu [OPTION]... [FILE]
DESCRIPTION
This program produces 1-d histograms from numerical or text data input. It can be also used to estimate the probability distribution func-
tion of a numerical variable - see http://en.wikipedia.org/wiki/Probability_density_function.
OPTIONS
-x <int>
x-data column (default is 1)
-y <int>
y-data column (default is 2); It is considered only when combined with '-m' or '-S'
-d <float|int>
delta size (dx-resolution) in case of numerical data; Keep in mind that 2 is not the same as 2.0: in the first case the numbers are
treated as integers, in the latter as floats.
-n normalize the result A) non-numerical data: n(x) = counts(x)/sum_of_counts B) numerical data: the normalized probability density
func.
is P(-INF < x <INF) = Int_[-INF:INF] P(x)*dx = 1 ; For the numerical integration an open x-data interval is assumed.
-N normalize data against the total sum of counts (same as option '-n' with case A forced)
-U normalize the result with x-range mapped to unit; The x-values are mapped to the interval [0:1], respectively Int_[0:1] P(x)*dx = 1;
This option is mutually exclusive with '-n'.
-S compute sums and normalized sums of y-values; The total sum of all y-values is used for the normalization.
-m compute the arithmetic mean of y-values in the respective x-bar
-s <int>
sort output using the specified column; Header is skipped in this case.
-g <int>
sort output numerically using the specified column; Header is skipped in this case.
-r do reverse sorting (in combination with '-g' and '-s')
-C center histogram bars (shifts x-axis by 0.5*dx)
-X treat hole line as one string (single data record)
-H print a data description header
-V print program version and exit
--version
output version and copyright information
--help display help
-h display short help (options summary)
Note: this program is not intended for use in high order numerical computations.
REPORTING BUGS
Report bugs to <gnu@mirendom.net>
COPYRIGHT
Copyright (C) 2003-2007, 2009, 2011 Dimitar Ivanov
License: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
maphimbu 2.8.4 February 2012 MAPHIMBU(1)