Sponsored Content
Top Forums Shell Programming and Scripting Multiline parenthesis matching, with e.g. SED script, in LaTeX doc Post 302458224 by bartus11 on Thursday 30th of September 2010 05:57:48 AM
Old 09-30-2010
Assuming all the curly braces are balanced:
Code:
perl -0ne 's/\\emph{//g;$i=0;while(/./gs){$i-- if $& eq "{";$i++ if $& eq "}"; if ($i<1){print $&}else{$i=0}}' infile > outfile

This User Gave Thanks to bartus11 For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

another sed question about parenthesis

hi, I'm trying to use sed to erase everything, up to, and including, the first closing parenthesis. for example: input: blah blah blah (aldj) test (dafs) test test. output: test (dafs) test test. how would i do this? I was fooling around with the parenthesis, and i only got it to apply to... (5 Replies)
Discussion started by: gammaman
5 Replies

2. Shell Programming and Scripting

Preparing LaTeX files using Sed/AWK for processing with latex2html

As the title states, my issue involves preparing LaTeX documents for processing with latex2html. Within my LaTeX docs I have used a package which allows me to cleanly display source code listings. However the package is not supported by latex2html which, when processed, does not display the... (3 Replies)
Discussion started by: oski
3 Replies

3. Shell Programming and Scripting

multiline pattern matching

Hi, I have a file of the following from: Afghanistan gdpcapit|800 Akrotiri Albania gdpcapit|6000 now I want have the gdpcapit value next to the country when there is one like this: Afghanistan 800 gdpcapit|800 Akrotiri Albania 6000 gdpcapit|6000 How do I do this? I've... (4 Replies)
Discussion started by: KarelVH
4 Replies

4. Shell Programming and Scripting

awk multiline matching

I have a file that looks something like this with lots of text before and after. Distance method: Sum of squared size difference (RST) </data> <pairwiseDifferenceMatrix time="02/08/11 at 13:08:27"> 1 2 1 448.82151 507.94231 2 ... (7 Replies)
Discussion started by: mgray
7 Replies

5. Shell Programming and Scripting

Need help with Sed (replacing parenthesis and comma)

I have the following text as an input text: input.txt Results('Toilet', 'Sink', ) and i want to remove the last comma so the output is output.txt Results('Toilet', 'Sink' ) I tried using the following sed command, but I get a parsing error: sed s/, \)/\)/g input.txt >... (5 Replies)
Discussion started by: jl487
5 Replies

6. UNIX for Dummies Questions & Answers

Need Multiline sed help!!

Hey everyone, I'm new to sed and I need to create a script for inserting one line of code at the beginning of every method in a Xcode project (over 6,000 methods). Each method Structure is (+ or -) (Various declarations-- could span multiple lines) ({) I've tried for days, any guidance would be... (2 Replies)
Discussion started by: jimmyz
2 Replies

7. Shell Programming and Scripting

sed help adding parenthesis

I have the following data and want to put parenthis around the numbers: PARTITION PERIOD_MIN VALUES LESS THAN 10649 TABLESPACE ODS_DAILY_MF_AUM, PARTITION PERIOD_10649 VALUES LESS THAN 10650 TABLESPACE ODS_DAILY_MF_AUM, PARTITION PERIOD_10650 VALUES LESS THAN 10651 TABLESPACE... (2 Replies)
Discussion started by: BeefStu
2 Replies

8. Shell Programming and Scripting

Multiline sed

Hi guys, I am fairly comfortable with using the sed command if the string to be replaced is all on a single line. I was wondering is it possible to use sed command in a multiline way ? Say for example I have the below string on 2 different lines: { "key": "brandNameA", ... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies

9. Shell Programming and Scripting

sed multiline problem

I'm trying to replicate the sed output on p.108 of Sed&Awk,by Doughery & Robbins, 2nd edition. I'm on a Windows 10 Surface Pro, running Cygwin for 64-bit versions of Windows. Input text saved in text file called data_p108.txt: Consult Section 3.1 in the Owner and Operator Guide for a... (9 Replies)
Discussion started by: prooney
9 Replies
LaTeX::Table::Themes::Classic(3pm)			User Contributed Perl Documentation			LaTeX::Table::Themes::Classic(3pm)

NAME
LaTeX::Table::Themes::Classic - Classic LaTeX table themes. PROVIDES
This module provides following themes: plain Animal Description Price Gnu stuffed 92.59 Emu stuffed 33.33 Miami Animal Description Price ---------------------------------- Gnu stuffed 92.59 Emu stuffed 33.33 Berlin +--------+-------------+--------+ | Animal | Description | Price | +========+=============+========+ | Gnu | stuffed | 92.59 | | Emu | stuffed | 33.33 | +--------+-------------+--------+ Dresden +--------++-------------+--------+ | Animal || Description | Price | +========++=============+========+ | Gnu || stuffed | 92.59 | | Emu || stuffed | 33.33 | +--------++-------------+--------+ Houston +--------++-------------+--------+ | Animal || Description | Price | +========++=============+========+ | Gnu || stuffed | 92.59 | +--------++-------------+--------+ | Emu || stuffed | 33.33 | +--------++-------------+--------+ Except for "plain", headers are printed in bold font. REQUIRES
The themes defined in this module require no additional LaTeX packages. NOTES
These are the classic themes you know from the famous books and tutorials. However, they have flaws. Read the "booktabs" documentation for a discussion of this. The "plain" theme might be useful in combination with the ltpretty script. SEE ALSO
LaTeX::Table, LaTeX::Table::Themes::ThemeI LICENSE AND COPYRIGHT
Copyright (c) 2006-2010 "<limaone@cpan.org>" This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. perl v5.10.1 2010-10-27 LaTeX::Table::Themes::Classic(3pm)
All times are GMT -4. The time now is 11:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy