Search Results

Search: Posts Made By: hernand
1,372
Posted By itkamaraj
what is the relation b/w the input and output ?
what is the relation b/w the input and output ?
29
5,758
Posted By bartus11
I implemented line swapping as well, check if it...
I implemented line swapping as well, check if it is working properly: #!/usr/bin/perl
open I, "$ARGV[0]";
@x=<I>;
$i=0;
for (@x){
s/ +$//;
$t=$_;
@s=split / +/;
if ($#s==12){
...
29
5,758
Posted By bartus11
Try this one: #!/usr/bin/perl open I,...
Try this one: #!/usr/bin/perl
open I, "$ARGV[0]";
@x=<I>;
$i=0;
for (@x){
s/ +$//;
$t=$_;
@s=split / +/;
if ($#s==12){
$i=1;
s/([^ ]+ +EUR)1([SB]\d+ +)[^ ]+( +)1/$1$2 ...
29
5,758
Posted By bartus11
Try this then: #!/usr/bin/perl open I,...
Try this then: #!/usr/bin/perl
open I, "$ARGV[0]";
@x=<I>;
$i=0;
for (@x){
s/ +$//;
$t=$_;
@s=split / +/;
if ($#s==12){
$i=1;
s/([^ ]+ +EUR)1([SB]\d+ +)[^ ]+( +)1/$1$2 ...
29
5,758
Posted By bartus11
No need to apologize ;) Try: #!/usr/bin/perl ...
No need to apologize ;) Try: #!/usr/bin/perl
open I, "$ARGV[0]";
@x=<I>;
$i=0;
for (@x){
s/ +$//;
$t=$_;
@s=split / +/;
if ($#s==11){
$i=1;
s/([^ ]+ +EUR)1([SB]\d+ +)[^ ]+(...
29
5,758
Posted By bartus11
Try: #!/usr/bin/perl open I, "$ARGV[0]"; ...
Try: #!/usr/bin/perl
open I, "$ARGV[0]";
@x=<I>;
chomp($d=`date +%Y%m%d`);
$i=0;
for (@x){
s/ +$//;
$t=$_;
@s=split / +/;
if ($#s==10){
$i=1;
s/([^ ]+ +EUR)1([SB]\d+ +)[^...
29
5,758
Posted By bartus11
Are you sure "30416938966" is Unix time? Current...
Are you sure "30416938966" is Unix time? Current Unix timestamp is "1307530654", so 23 times less than your number. Also using simple Perl converter doesn't seem to recognize your number as Unix...
2,541
Posted By Skrynesaver
30416938966 is not an epoch time, at least not...
30416938966 is not an epoch time, at least not this millennium it's not.

to convert from epoch to your format try

perl -e'
@time=localtime($epoch) ;
printf...
2,541
Posted By getmmg
Hi, Can you post the the code which gives...
Hi,

Can you post the the code which gives the output as shown above.
29
5,758
Posted By bartus11
EUR1B892 and EURB1892 are quite different... Try...
EUR1B892 and EURB1892 are quite different... Try this:#!/usr/bin/perl
open I, "$ARGV[0]";
@x=<I>;
$i=0;
for (@x){
s/ +$//;
$t=$_;
@s=split / +/;
if ($#s==10){
$i=1;
s/([^ ]+...
29
5,758
Posted By bartus11
[root@linux ~]# ./a.pl c H: EURS891 ...
[root@linux ~]# ./a.pl c
H: EURS891 10440000000000.003000000450 FR0000130007 2ALUp 20110607-08:34:25TRADETES PA TRADETES TESTCLRXX #
H: EURB891 ...
29
5,758
Posted By Shahul
$ nawk '{if(NF>10) {print $0"-"NR"\n"$0} else...
$ nawk '{if(NF>10) {print $0"-"NR"\n"$0} else {print $0}}' input.txt|nawk 'NF>11 {$2="EUR"$3;$3="";$NF=""}{print |"sort -n -k3 -r"}'


Thanks
Sha
29
5,758
Posted By bartus11
Try this script: #!/usr/bin/perl open I,...
Try this script: #!/usr/bin/perl
open I, "$ARGV[0]";
@x=<I>;
$i=0;
for (@x){
s/ +$//;
$t=$_;
@s=split / +/;
if ($#s==10){
$i=1;
s/([^ ]+ +EUR[SB])1(\d+ +)[^ ]+( +)1/$1$2 ...
29
5,758
Posted By bartus11
Ok, so if three consecutive lines have 11...
Ok, so if three consecutive lines have 11 columns, then three new lines should be inserted above them? Example.. input:H: EURS1892 S892 10440000000000.003000000450 FR0000130007 2ALUp ...
29
5,758
Posted By bartus11
Can the output look like this? H: EURS890 ...
Can the output look like this? H: EURS890 00440000000069.110100000963 DE0008032004 2CBKd 20110607-07:50:59BNABFRPP DE BNABFRPP PARBFRPP #
H: EURB890 ...
29
5,758
Posted By bartus11
Try: perl -0ne '$x=$_;s/^([^ ]+ +AAA)1([^ ]+)(...
Try: perl -0ne '$x=$_;s/^([^ ]+ +AAA)1([^ ]+)( +)[^ ]+( +)1([^ ]+ +[^ ]+$)/$1$2$3 ${4}0$5/mg;print $_,$x' file
29
5,758
Posted By bartus11
Try: perl -0ne '$x=$_;s/^([^ ]+ +AAA)1([^ ]+)(...
Try: perl -0ne '$x=$_;s/^([^ ]+ +AAA)1([^ ]+)( +)[^ ]+( +)1/$1$2$3 ${4}0/mg;print $_,$x' file
3,287
Posted By itkamaraj
let me know the time taken, once the script is...
let me know the time taken, once the script is finished
3,287
Posted By itkamaraj
use echo -e
use echo -e
3,287
Posted By itkamaraj
Try this.. echo...
Try this..


echo "hour\tminutes\tseconds\tmiliseconds" > output.txt
for hour in `seq -w 00 23`
do
for minutes in `seq -w 00 59`
do
for seconds in `seq -w 00 59`
do
for...
3,287
Posted By itkamaraj
is that you looking for ? i dont know how...
is that you looking for ?

i dont know how much time it will take to complete


echo "hour\tminutes\tseconds\tmiliseconds" > output.txt
for hour in `seq -w 00 23`
do
for minutes in `seq -w...
1,152
Posted By bartus11
perl -0pe 's/(.*\n)(.*\n)/\2\1/g' file
perl -0pe 's/(.*\n)(.*\n)/\2\1/g' file
1,152
Posted By Scrutinizer
awk 'getline x{print x}1' infile
awk 'getline x{print x}1' infile
1,152
Posted By alister
sed -n 'h; n; G; p' If you'd prefer to keep...
sed -n 'h; n; G; p'

If you'd prefer to keep the last line when there are an odd number of lines:
sed -n '$p; h; n; G; p'

Regards,
Alister
1,152
Posted By michaelrozar17
One way would be.. awk '{s=$0;getline;print...
One way would be..
awk '{s=$0;getline;print $0"\n" s}' inputfile > outfile
Showing results 1 to 25 of 34

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