Sponsored Content
Top Forums Shell Programming and Scripting Extracting Tag along with specific lines Post 302529069 by vgersh99 on Wednesday 8th of June 2011 12:03:21 PM
Old 06-08-2011
Code:
nawk -F, '/>/{print;next} NF { if($NF ~ "^Buckle=A[_]*") print $1, "Buckle=A"}' myFile

Not sure if you want to pick up Buckle=A and Buckle_A_OI (based on some of your previous posts).

Last edited by vgersh99; 06-08-2011 at 01:16 PM.. Reason: _ in A_ should be optional
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

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 -... (3 Replies)
Discussion started by: krabu
3 Replies

2. Shell Programming and Scripting

extracting specific lines from a file

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

3. Shell Programming and Scripting

Extracting the value of an attribute tag from XML

Greetings, I am very new to the UNIX shell scripting and would like to learn. However, I am currently stuck on how to process the below sample of code from an XML file using UNIX comands: <ATTRIBUTE NAME="Memory" VALUE="512MB"/> <ATTRIBUTE NAME="CPU Speed" VALUE="3.0GHz"/> <ATTRIBUTE... (5 Replies)
Discussion started by: JesterMania
5 Replies

4. Shell Programming and Scripting

extracting specific text from lines

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

5. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

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

6. UNIX for Dummies Questions & Answers

Filtering data -extracting specific lines

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

7. UNIX for Advanced & Expert Users

Extracting specific lines from data file

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

8. UNIX for Dummies Questions & Answers

Extracting data between specific lines, multiple times

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

9. Shell Programming and Scripting

Extracting a string from html tag

Hi I am new to string extractions in shell script... I am trying to extract a string such as #1753 from html tag looks like below. <a class="model-link tl-tr" href="lastSuccessfulBuild/">Last successful build (#1753), 40 min ago</a> and want the value as 1753 Could someone help me to... (3 Replies)
Discussion started by: hicharbo
3 Replies

10. Shell Programming and Scripting

Moving XML tag/contents after specific XML tag within same file

Hi Forum. I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script. Any feedback will be greatly appreciated. ... (19 Replies)
Discussion started by: pchang
19 Replies
__gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >(3cxx)			      __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >(3cxx)

NAME
__gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc > - SYNOPSIS
Inherits type< _Tv, Cmp_Fn, _Alloc, Tag >. Public Types typedef _Alloc allocator_type typedef Cmp_Fn cmp_fn typedef base_type::const_iterator const_iterator typedef __rebind_va::const_pointer const_pointer typedef __rebind_va::const_reference const_reference" typedef Tag container_category typedef allocator_type::difference_type difference_type" typedef base_type::iterator iterator typedef base_type::point_const_iterator point_const_iterator" typedef base_type::point_iterator point_iterator typedef __rebind_va::pointer pointer typedef __rebind_va::reference reference typedef allocator_type::size_type size_type typedef _Tv value_type Public Member Functions priority_queue (const cmp_fn &r_cmp_fn) template<typename It > priority_queue (It first_it, It last_it) template<typename It > priority_queue (It first_it, It last_it, const cmp_fn &r_cmp_fn) priority_queue (const priority_queue &other) priority_queue & operator= (const priority_queue &other) void swap (priority_queue &other) Detailed Description template<typename _Tv, typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>class __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc > A priority queue composed of one specific heap policy. Template Parameters: _Tv Value type. Cmp_Fn Comparison functor. Tag Instantiating data structure type, see container_tag. _Alloc Allocator type. Base is dispatched at compile time via Tag, from the following choices: binary_heap_tag, binomial_heap_tag, pairing_heap_tag, rc_binomial_heap_tag, thin_heap_tag Base choices are: detail::binary_heap, detail::binomial_heap, detail::pairing_heap, detail::rc_binomial_heap, detail::thin_heap. Definition at line 83 of file priority_queue.hpp. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Sun Jan 6 2013 __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >(3cxx)
All times are GMT -4. The time now is 06:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy