Search Results

Search: Posts Made By: Lokesha
2,334
Posted By Lokesha
This solution worked. Thanks a lot.
:b:

---------- Post updated at 11:23 PM ---------- Previous update was at 11:22 PM ----------

This solution worked. Thanks a lot. great help!
2,334
Posted By Lokesha
Solution did not work and errored !
Thanks for the reply, but your solution didn't work and errored!

sed 's/\(\([^;]*;\)\{4\}\)\([^;]*;\)\(.*\)/echo -n "\1"$(date -d-$((${RANDOM}%4000))day "+%Y%m%d;")$(date -d-$((${RANDOM}%4000))day...
2,334
Posted By Lokesha
solution not worked and got error!
I've inserted your code inside 'addColumn.sh' and tried, but got the error:

awk -F ';' 'BEGIN {
OFS=FS
sd=1167573600
ed=1577800800
srand()
}
NF>3{
...
2,334
Posted By Lokesha
Randomly inserting extra columns into csv file
Hi Tech Guru,

I have a test file as below [in reality its a very big file], which needs some more fields to be populated randomly :

dks3243;12;20130823;1420;25m;0;syt
dks3243;rocy;10...
6,625
Posted By Lokesha
Thanks for the help & reply. Now, we are...
Thanks for the help & reply.

Now, we are discussing about below script:

#!/usr/bin/perl

use strict;

# vars we need
my $file_a = "a.txt";
my $file_b = "b.txt";
my $file_c = "c.txt";
my...
6,625
Posted By Lokesha
Thanks in2nix4life. The problem with your...
Thanks in2nix4life.

The problem with your script is below piece of code line:

@UNIQUE = grep(! defined $HASH{$_}, @FILEB);

I thinks the above code matching for entire line. As each line in...
6,625
Posted By Lokesha
Thanks royalibrahim, But I need it in a perl...
Thanks royalibrahim,

But I need it in a perl script instead of running on command line.
Can you help me?

Regards.
6,625
Posted By Lokesha
Hi durden_tyler, Thank you very much for your...
Hi durden_tyler, Thank you very much for your reply.

But, the mentioned piece of code is very high level for me. I need it in a script instead of running it on command line. How can I convert your...
6,625
Posted By Lokesha
Perl - multiple keys and merging two files
Hi,

I'm not a regular coder but some times I write some basic perl script, hence Perl is bit difficult for me :).

I'm merging two files a.txt and b.txt into c.txt:

a.txt
------...
3,216
Posted By Lokesha
Thanks for the reply drl. But I donot want...
Thanks for the reply drl.

But I donot want to lock the CSV file, it should be open for all the scripts to update their data? Please correct me, if I'm understanding your intention wrongly.

With...
3,216
Posted By Lokesha
Thanks for your reply, Ganapati. I thought...
Thanks for your reply, Ganapati.

I thought so, but I don't know whether this is the right approach to allow multiple scripts to write the same CSV file.
3,216
Posted By Lokesha
Updating a CSV file by multiple PERL scripts
Hi Friends,

I'm writing code to update a CSV file by multiple PERL scripts.
I've around 2000 PERL scripts which need to register their entries into a CSV file. Hence, I'm inserting following...
6,629
Posted By Lokesha
Hi Ganapati. I think that problem due to...
Hi Ganapati.

I think that problem due to scope of the array and its elements. Try that.
May be some experts can help you!!

All the best.
2,454
Posted By Lokesha
Thanks, I've got answer from my friend, it...
Thanks,

I've got answer from my friend, it is as below:

#!/usr/bin/perl

use File::Find;
use strict;

my $directory = "/software/app/AlgoSuite/glk/FILES";
#my $directory =...
2,454
Posted By Lokesha
grep problem in perl
Hi,

I'm writing one perl script to select only a number part from a line. These lines looks as:

raj born on 20080201 at delhi
result for the equation [(A+B) * (B*C)] is (886005)
peter get...
2,639
Posted By Lokesha
Got the answer
sorry for silly question.

It was my mistake by understanding the substr() function.
Now I corrected my code.

awk '{
printf (" %-6s\n", substr($0,18,6))
}' file.txt

Please forgive...
2,639
Posted By Lokesha
Problem with "printf"
Hi All,

I've one problem with printf.

Iam printing some field values from one file "file.txt" using printf, which is resulting anonymously.

awk '{
printf (" %-6s\n", substr($0,18,23))
...
1,843
Posted By Lokesha
Reading environmental variable values
Hi Sir's

I've the below piece of code has the following functionalities:

1) Read the "pcp" file and create Job related parameter file "$PARMFILE".
$PARMFILE has below variables:
AFTD2010...
5,400
Posted By Lokesha
small problem
One more problem,

Radoulov- I'm using the your below code:

nawk 'f[FILENAME]==1&&!/^\*TM\*/;/^\*TM\*/{f[FILENAME]++}' $(<list_file) > complete.txt

Since datafile and list will not be in the...
5,400
Posted By Lokesha
Which code to use (for performance)
Thanks a lot,

Two questions here:

1) Radoulov - Your code is amazing, but what is the difference between the two option which you have given? I was not clear for "If the filenames contain no...
5,400
Posted By Lokesha
logics for the selection
Thanks Jim mcnamara,

But you are not reading "list_file" which will have the only file names that are need to select.

Also we can't select the data as '/^Data/', because it is not always...
5,400
Posted By Lokesha
AWK instead of Shell script
I've a list file, which has some file names.
ex: list file "list_file" will have

data_file1.txt
data_file2.txt
data_file3.txt
:
:
data_filen.txt


Above files will have the below layout:...
4,460
Posted By Lokesha
Output file should be in the below format ...
Output file should be in the below format

Header
Detailed record 1
.
.
Detailed record n
Trailer

List file is in the below format:

input_file1
input_file2
.
.
input_filen

And...
3,143
Posted By Lokesha
Quick help on space padding
Hi all,

I need to create a header record of width 121 charecter with below fields,
position 001-001 - 0
position 002-15 - filled with space
position 016-020 - date value
position 021-121 -...
30,924
Posted By Lokesha
Thanks Karnan, I've some more questions....
Thanks Karnan,

I've some more questions. Reqst you to answer these.
1) Why 'env' is used there?
2) This line of code is used in all the Control-M script, why they are searching for '..mn' (tow...
Showing results 1 to 25 of 36

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