Search Results

Search: Posts Made By: dynamax
3,435
Posted By kshji
Here are two solution, using pure ksh/bash or...
Here are two solution, using pure ksh/bash or awk, not mixed.

#!/usr/bin/someposixshell ksh, bash, dash, ...

# make tmp file for input
cat <<EOF > $0.tmp
Name : sdt2156157_ID
NOS : 4567 [...
2,149
Posted By mirni
Got gawk? awk ' ...
Got gawk?
awk '
(strtonum("0x"$1)!=strtonum("0x"last)+1){ #discontinuity encountered
if(last) #don't print if last undefined
printf("%s:%s,...
1,824
Posted By birei
Hi Try next 'Perl' script: $ cat...
Hi

Try next 'Perl' script:

$ cat script.pl
use warnings;
use strict;
use autodie;

@ARGV == 1 or die "Usage: perl $0 input-file\n";
open my $fh, "<", $ARGV[0];

my $cnt = 5;
my @f;
...
1,824
Posted By Chirel
Hi, Try this $memcnt = 5; $passt =...
Hi,

Try this

$memcnt = 5;
$passt = "ship";
$cnt1 = 0;
open (ADVOUT, "< $chpdvlst") || die ("can not open file: $chpdvlst!");
while (($LINEIN2 = <ADVOUT>) && ($cnt1 < $memcnt)) {

...
6,507
Posted By bartus11
echo 036A 4 2 | perl -ane '$F[0]=hex $F[0];for...
echo 036A 4 2 | perl -ane '$F[0]=hex $F[0];for ($j=0;$j<$F[2];$j++){printf "%s%.4X%s","Group ID ",$F[0]++,", members below;\n";for ($i=1;$i<$F[1];$i++){printf "%.4X\n",$F[0]++}}'
8,339
Posted By ahamed101
You can execute the same command within perl also...
You can execute the same command within perl also


#!/bin/perl
my $var=`grep -v visitor abc.txt |grep '.'`;
print $var;


regards,
Ahamed
2,231
Posted By Franklin52
Use nawk or /usr/xpg4/bin/awk on Solaris.
Use nawk or /usr/xpg4/bin/awk on Solaris.
2,582
Posted By zedex
1. Whenever you post a code try to use "" tags,...
1. Whenever you post a code try to use "" tags, it makes it easier to read.

2. After writing every perl program, run perl -c <PROG_NAME> to make sure there are no obvious mistakes.

3. You...
4,200
Posted By birei
Hi, Perl use the token 'elsif' instead 'else...
Hi,

Perl use the token 'elsif' instead 'else if'. Try changing them, like this (line 67):

elsif (($LINEIN3 =~ 'ship') && ($LINEIN3 =~ 'N/Grp'))
{
print...
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 12:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy