Sponsored Content
Top Forums Shell Programming and Scripting Select block of text around matching braces Post 302295943 by summer_cherry on Tuesday 10th of March 2009 03:27:40 AM
Old 03-10-2009
Code:
#!/usr/bin/perl
undef $/;
open FH,"<a.txt";
$str=<FH>;
@arr=split(/#[0-9]+.* Block/,$str);
map {s/[\n ]//g} @arr;
print join "\n",@arr;

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Select last block from a file

Hi, I have to always select last portion of a block identified by 2 fixed keywords which repeats in a file for eg START .... ... END START .... ... END START .... ... END (9 Replies)
Discussion started by: misenkiser
9 Replies

2. UNIX for Dummies Questions & Answers

Select text within matching ( ) bracket

Hi, I am looking for a simple command to select text within a open bracket "(" and a matching close bracket ")" and output the within-bracket-text to a file. This function is similar to the common vi select a range of text with "(" to ")" but not sure how to run the same function in command... (4 Replies)
Discussion started by: cursive
4 Replies

3. Shell Programming and Scripting

Finding the line number of matching braces

Hi,I am new to shell scripting and i want to find the line numbers of matching braces. The file contents are as follows File XXX.dat 1 ( CLASS "FRUIT" 2 (TYPE "PERSISTENT") 3 (MESSAGE_TYPE "M") 4 (GET_REQRD "Y") 5 (SET_REQRD "Y") 6 ) 7 ( CLASS... (3 Replies)
Discussion started by: Rajendra_1510
3 Replies

4. Shell Programming and Scripting

how to find matching braces using sed or in shell script

hi, I want to print all the lines between the matching braces. For example,the file contains like the below. asdfsdf fsdfsd WO{ w1{ ada ... (3 Replies)
Discussion started by: Boopesh
3 Replies

5. UNIX for Dummies Questions & Answers

How to select text within the second ()?

Hello, Can someone advise me how to select the text within the second bracket of a string in shell script? For example, the input file: some message (string A) some message (string B) some message (string C) some message (string D) some message (string E) The number of bracket is random... (4 Replies)
Discussion started by: hanul
4 Replies

6. Shell Programming and Scripting

Block of records to select from a file

Hello: I am new to shell script programming. Now I would like to select specific records block from a file. For example, current file "xyz.txt" is containing 1million records and want to select the block of records from line number 50000 to 100000 and save into a file. Can anyone suggest me how... (3 Replies)
Discussion started by: nvkuriseti
3 Replies

7. Shell Programming and Scripting

Select the exact matching contents using grep

Hi everyone I've two files.. The contents of file1 are as shown below 4 5 12 13 36 37 45 46 47 The contents of file2 are as shown below 21 hello 13 world (5 Replies)
Discussion started by: abk07
5 Replies

8. Shell Programming and Scripting

Like to select text in a From/To list

Hi I need help to configure AWK to find a string based From/To filed I have a table like this 0A00 - 0AFF Nuts 0B00 - 0BFF Bolt If I have in a program a value like "0B22" I wold like to get "Bolt" in return. List are in Hex Still try to learn AWK :) (3 Replies)
Discussion started by: Jotne
3 Replies

9. Shell Programming and Scripting

Grep text matching problem with script which checks if web page contains text.

I wrote a Bash script which checks to see if a text string exists on a web page and then sends me an email if it does (or does not e.g. "Out of stock"). I run it from my crontab, it's quite handy from time to time and I've been using it for a few years now. The script uses wget to download an... (6 Replies)
Discussion started by: gencon
6 Replies

10. Shell Programming and Scripting

How do I select certain columns with matching pattern and rest of the lines?

I want to select 2nd, 3rd columns if line has "key3" and print rest of the lines as is. # This is my sample input key1="val1" key2="val2" key3="val3" key4="val4" some text some text some text some text key1="val1" key2="val2" key3="val3" key4="val4" some text some text some text some... (3 Replies)
Discussion started by: kchinnam
3 Replies
Gtk2::RcStyle(3pm)					User Contributed Perl Documentation					Gtk2::RcStyle(3pm)

NAME
Gtk2::RcStyle - wrapper for GtkRcStyle HIERARCHY
Glib::Object +----Gtk2::RcStyle METHODS
rcstyle = Gtk2::RcStyle->new color = $style->base ($state, $new=undef) o $state (Gtk2::StateType) o $new (Gtk2::Gdk::Color or undef) color = $style->bg ($state, $new=undef) o $state (Gtk2::StateType) o $new (Gtk2::Gdk::Color or undef) scalar = $style->bg_pixmap_name ($state, $new=undef) o $state (Gtk2::StateType) o $new (string or undef) rcflags = $style->color_flags ($state, $new=0) o $state (Gtk2::StateType) o $new (Gtk2::RcFlags) rcstyle = $orig->copy color = $style->fg ($state, $new=undef) o $state (Gtk2::StateType) o $new (Gtk2::Gdk::Color or undef) scalar = $style->font_desc ($new=undef) o $new (scalar) scalar = $style->name ($new=undef) o $new (scalar) color = $style->text ($state, $new=undef) o $state (Gtk2::StateType) o $new (Gtk2::Gdk::Color or undef) scalar = $style->xthickness ($new=undef) o $new (scalar) scalar = $style->ythickness ($new=undef) o $new (scalar) ENUMS AND FLAGS
flags Gtk2::RcFlags o 'fg' / 'GTK_RC_FG' o 'bg' / 'GTK_RC_BG' o 'text' / 'GTK_RC_TEXT' o 'base' / 'GTK_RC_BASE' enum Gtk2::StateType o 'normal' / 'GTK_STATE_NORMAL' o 'active' / 'GTK_STATE_ACTIVE' o 'prelight' / 'GTK_STATE_PRELIGHT' o 'selected' / 'GTK_STATE_SELECTED' o 'insensitive' / 'GTK_STATE_INSENSITIVE' SEE ALSO
Gtk2, Glib::Object COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::RcStyle(3pm)
All times are GMT -4. The time now is 10:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy