Sponsored Content
Top Forums Shell Programming and Scripting Refining if loops using sed/awk Post 302259810 by engineer on Wednesday 19th of November 2008 04:04:43 AM
Old 11-19-2008
Chris, I need to put the { by checking the presence of ")" .The content a,b can be anything..

Last edited by engineer; 11-19-2008 at 05:10 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

While loops and awk

I am trying to make a script that will replace backslashes in a file, but only if the occurance is a pathname. In the file, there are a lot of regular expressions as well, so I'm trying to preserve the integrity of those regular expressions, but convert Windows relative paths. I'm using bash and... (1 Reply)
Discussion started by: Loriel
1 Replies

2. Shell Programming and Scripting

Awk formatting of a data file - nested for loops?

Hello - is there any way in awk I can do... 4861 x(1) y(1) z(1) 4959 x(1) y(1) z(1) 5007 x(1) y(1) z(1) 4861 x(2) y(2) z(2) 4959 x(2) y(2) z(2) 5007 x(2) y(2) z(2) 4861 x(3) y(3) z(3) 4959 x(3) y(3) z(3) 5007 x(3) y(3) z(3) to become... 4861 x(1) y(1) z(1) 4861 x(2) y(2) z(2)... (3 Replies)
Discussion started by: catwoman
3 Replies

3. Shell Programming and Scripting

sed used in loops

Hello: This is my first post here, regarding my first attempt at shell scripting.I was given a large amount of word documents which I need to first make into text files, and then change the commercial names to generic names (they are lists of therapeutic drugs), as well as remove some unnecesary... (1 Reply)
Discussion started by: riayi
1 Replies

4. UNIX for Dummies Questions & Answers

Passing KSH variable to AWK with two loops

Hi, I need some help to figure out why an outer for loop KSH variable does not decode in AWK but inner for loop does. Below is my code, If I hard code variable 'SUBSEQ' in AWK it works but if I try to pass the SUBSEQ from KSH, it does not and when I pass the variable 'NAM' from KSH it works: I... (1 Reply)
Discussion started by: chowdhut
1 Replies

5. Shell Programming and Scripting

awk command to avoid loops

Hi... I need a help in using the awk command or any other solution to avoid the usage of loops. My question is : I have a input like this : field1|field2|field3|field4|field5|field6|field7|field8|field9 ex : 4000|testing|scenario|14450|500|320|450|200|100 where the... (2 Replies)
Discussion started by: vijayarajvp
2 Replies

6. Shell Programming and Scripting

SOLVED: Refining an awk command

I have a file (file1) with in the below format ST*820*212121 BPR*C*213212.20*C*212*CCD*01***01*071000013*DA*321321*101208 TRN*1*21321321*13213 N1*PR*3232. dff. SYS.*91*3232 ENT*1 N1*PE* 2132121321 RMR*TN*234456677888**192387.20*192387.20 REF*IV*234456677888*213213 3213 UNI... (0 Replies)
Discussion started by: Muthuraj K
0 Replies

7. UNIX for Dummies Questions & Answers

Bourne-sh (not bash) question about nested loops and sed

Here's the input: alpha, numeric or alphanumeric string ("line 1 string") numeric string ("line 2 string") numeric string ("line 3 string") numeric string ("line 4 string") ... where - each numeric string is in a pattern that can be matched with RE but - there can be any number of... (2 Replies)
Discussion started by: uiop44
2 Replies

8. UNIX Desktop Questions & Answers

awk using 2 input files instead of while loops

Hi Friends, I have two files as input with data that looks like this: file1.txt 1 2 3 4 file2.txt a,aa b,bb c,cc d,dd e,ee f,ff instead of me doing 2 while loops to get the combinations while read line_file1 (2 Replies)
Discussion started by: kokoro
2 Replies

9. UNIX for Dummies Questions & Answers

Dealing with Empty files, AWK and Loops

I write this bit of code to calculate the mean and variance for all the files in one directory and print the mean and variance in a separate folder but with the same file name. FILES="data/*" for X in $FILES do name=$(basename $X) awk '{x=$0; s+=$0; n++} END{mean=s/n; for (i in x){ss... (20 Replies)
Discussion started by: A-V
20 Replies

10. Shell Programming and Scripting

Help with refining script

Happy new year all! I would like to ask for some assistance refining the script I have put together below. I am a noob with bash scripting and still getting used to all the options available originally coming from a windows background couch, couch... Now I am more than happy in NIX world :b::)... (13 Replies)
Discussion started by: Simplify
13 Replies
MooseX::POE::SweetArgs(3pm)				User Contributed Perl Documentation			       MooseX::POE::SweetArgs(3pm)

NAME
MooseX::POE::SweetArgs - sugar around MooseX::POE event arguments VERSION
version 0.215 SYNOPSIS
package Thing; use MooseX::POE::SweetArgs; # declare events like usual event on_success => sub { # unpack args like a Perl sub, not a POE event my ($self, $foo, $bar) = @_; ... POE::Kernel->yield('foo'); ... }; DESCRIPTION
Normally, when using MooseX::POE, subs declared as events need to use POE macros for unpacking @_, e.g.: my ($self, $foo, $bar) = @_[OBJECT, ARG0..$#_]; Using MooseX::POE::SweetArgs as a metaclass lets you avoid this, and just use @_ as normal: my ($self, $foo, $bar) = @_; Since the POE kernel is a singleton, you can access it using class methods, as shown in the synopsis. In all other respects, this behaves exactly like MooseX::POE AUTHORS
o Chris Prather <chris@prather.org> o Ash Berlin <ash@cpan.org> o Chris Williams <chris@bingosnet.co.uk> o Yuval (nothingmuch) Kogman o Torsten Raudssus <torsten@raudssus.de> <http://www.raudssus.de/> COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Chris Prather, Ash Berlin, Chris Williams, Yuval Kogman, Torsten Raudssus. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-04-25 MooseX::POE::SweetArgs(3pm)
All times are GMT -4. The time now is 12:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy