Sponsored Content
Full Discussion: using sed with indexes
Top Forums UNIX for Dummies Questions & Answers using sed with indexes Post 77732 by r2007 on Tuesday 12th of July 2005 10:57:06 AM
Old 07-12-2005
gnu sed:
Code:
sed 'h;s/.......//;x;s/\(.......\).*/\1/;s/ /0/g;G;s/\n//'

 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Analyze the indexes and rebuild them

Hello UNIX and Oracle Gurus, After doing an intensive search from different websites, the UNIX forum I am posting this message seeking help.. I am trying to accomplish the following tasks through the shell script: 1. Rebuild indexes on a Table in Oracle 2. Analyze indexes and table... (0 Replies)
Discussion started by: madhunk
0 Replies

2. Shell Programming and Scripting

matrix indexes

I wanted to use matrixs in awk and got some problem, here is some of the script code, from the BEGIN tag: row_char="a";row_char="b";row_char="c";row_char="d";row_char="e"$ row_char="h";row_char="i";row_char="j";row_char="k"; from the proccess passage: sentence,1]=1; diffrence=4; i=7;... (2 Replies)
Discussion started by: tal
2 Replies

3. Red Hat

[Errno 22] invalid mode ('w') or filename: '//var/lib/yum/rpmdb-indexes/conflicts.tmp'

Can anyone help me with this error? sudo yum install perl-Gtk2-WebKit Loaded plugins: langpacks, presto, refresh-packagekit, versionlock Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package perl-Gtk2-WebKit.i686 0:0.09-1.fc15 will be installed -->... (0 Replies)
Discussion started by: cokedude
0 Replies

4. Shell Programming and Scripting

remote/automated OS X folder label indexes triggered from PHP

I have a shell script that updates OS X color label indexes of folders/files as specified in an XML file. This works from terminal, but not when I trigger it from Apache/PHP. The server is not public, so not too worried about security. I've tried to allow access in sudoers, but no dice. I could use... (1 Reply)
Discussion started by: bradlecat
1 Replies

5. Shell Programming and Scripting

open files with multiple indexes

Hi, I want to work with multiple files which all contain 2 numbers. I tried to make a nested for loop but for some reason it doesn't recognize the $j as a number. The output is cannot open file `175-T-pvalue.xls'. How do I make sure that it takes the numbers from the inner loop as $j? ... (4 Replies)
Discussion started by: linseyr
4 Replies

6. Shell Programming and Scripting

sed and awk giving error ./sample.sh: line 13: sed: command not found

Hi, I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :- ./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies

7. Shell Programming and Scripting

I need to find out disk usage for particular indexes for different hosts

Need disk utilisation script for particular indexes on few hosts (3 Replies)
Discussion started by: Krish5v
3 Replies

8. UNIX for Beginners Questions & Answers

Adding indexes with PERL

Hello. I'm trying to self learn Perl and am stuck. I have a data.csv file that contains the following: 5,10,15,20,15,30 1,2,3,4,5 3,10 11 I'm trying to get Perl to take the indexes and add them all together to get 134. It says I need to use split and invoke the file via <> (built-in... (2 Replies)
Discussion started by: Eric7giants
2 Replies
Reindex(3)						       perl/Tk Documentation							Reindex(3)

NAME
Tk::Reindex - change the base index of Text-like widgets SYNOPSIS
use Tk::ReindexedText; $t1=$w->ReindexedText(-linestart => 2); use Tk::ReindexedROText; $t2=$w->ReindexedROText(-linestart => 0); DESCRIPTION
Creates a new widget class based on Text-like widgets that can redefine the line number base (normally Text widgets start line numbers at 1), or possibly other manipulations on indexes. STANDARD OPTIONS
The newly-defined widget takes all the same options as the base widget, which defaults to Text. WIDGET-SPECIFIC OPTIONS Name: lineStart Class: LineStart Switch: -linestart Sets the line number of the first line in the Text widget. The default -toindexcmd and -fromindexcmd use this configuration option. -item Name: toIndexCmd fromIndexCmd -item Class: ToIndexCmd FromIndexCmd -item Switch: -toindexcmd -fromindexcmd These two options specify callbacks that are called with a list of indexes and are responsible for translating them to/from indexes that the base Text widget can understand. The callback is passed the widget followed by a list of indexes, and should return a list of translated indexes. -toindexcmd should translate from 'user' indexes to 'native' Text-compatible indexes, and -fromindexcmd should translate from 'native' indexes to 'user' indexes. The default callbacks simply add/subtract the offset given by the -linestart option for all indexes in 'line.character' format. It would probably be prudent to make these functions inverses of each other. CLASS METHODS
import To make new Reindex widgets, this function should be called via use with the name of the Text-like base class that you are extending with "Reindex" capability. 'use base(Tk::Reindex Tk::nameofbasewidget)' should also be specified for that widget. BUGS
I've used the word "indexes" instead of "indices" throughout the documentation. All the built-in perl code for widget bindings & methods will use the new 'user' indexes. Which means all this index manipulation might might break code that is trying to parse/manipulate indexes. Or even assume that '1.0' is the beginning index. Tk::Text::Contents comes to mind. AUTHOR
Andrew Allen <ada@fc.hp.com> This code may be distributed under the same conditions as Perl. Tk1.1 2007-05-05 Reindex(3)
All times are GMT -4. The time now is 10:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy