Yes, I don't think it will work as what you have posted in the first post.
Try this...
--ahamed
second reply with same looks, guess thats the way.. but can i got a stet beyond and have the other way.. like what i found at another thread?
ls -ltra| awk '{ for (i=1;i<=NF;i++) { if ( i > 8 ) printf("%s ",$i) else printf("%s|",$i) } printf("\n") }'
What is it that you are actually looking for?... You asked to optimize your code, we did without losing the functionality. If your requirement is something else, please provide more clarity and if possible some input and expected output etc
What is it that you are actually looking for?... You asked to optimize your code, we did without losing the functionality. If your requirement is something else, please provide more clarity and if possible some input and expected output etc
Help us to Help you!
--ahamed
now im embarrassed yeah the code is optimized and i thank you a lot.. i just wanted to make it even faster by invoking awk just once per file..
the option provided is was faster already, but i'm greedy and i want to make it even faster..
i wanted to open the file,
then
do the loops and the operations
then
close the file
and theres no output atm.. im assigning vars with this code
the problem is.. my loop is 100k+ passes long
and i have this:
i'm opening each one of the 2 file 4 times... thats time consuming... can any warlock around make it so that i open each file just once? i'm digging but i rly dont have that much time... yeah we always w8 til last minute :P i believe i may eventually come up with sth.. but i thought i could ask you guys this
once again.. thx.. this forum is rly alive! )
---------- Post updated at 02:24 PM ---------- Previous update was at 12:25 PM ----------
i am looking 4 sth similar to:
so far im trying to debug thou im not sure ill get somewhere
---------- Post updated at 04:38 PM ---------- Previous update was at 02:24 PM ----------
or maybe sth like this,,,
any1?
Last edited by calim_cfd; 11-28-2011 at 06:52 PM..
Reason: adding html, cleaning, addin input
I need to pass values at runtime for the below awk command where
l is the length and partial.txt is the file name.
awk -v l=285 '{s="%-"l"s\n";printf(s,$0);}' partial.txt > temp1.txt; (5 Replies)
To fix an "issue" we're having I need to update SHMMAX from 1GB to 2Gb, it's a dynamic parameter so am just wondering how flexible it really is.
As Oracle is running on the server do I need to shut that down to change the parameter or will it just take the change on the fly?
Also how would I... (6 Replies)
Hello everyone!!
I need help with this please:
I have a file with this content:
56977964333 730030201857822 1
2
4
56976969284 730030201412442 1
2... (3 Replies)
Hi,
The below script is working fine
awk1.sh
=======
awk BEGIN { FS="|" } FNR==NR { f1=$2; next } $1 in f1 && $2 =="xx" && $1 == "DAILY_JOB" {print $3}
awk -f awk1.sh a.txt b.txt--Its working fine .
When passing parameters its not working .Any help it should be appereciated.
... (4 Replies)
Is there a way to preform check if the parameters that was send with the command awk -f `file_name.awk` `input_file` before even it gets to the BEGIN section (i have tested a try to check in the BEGIN it doesn't let ,you must make it on the section that after the BEGIN) and then decide if the... (1 Reply)
Hello,
How can I make an alias of an AWK one liner that prints specific lines from a file like below?
# from a command like this:
awk 'NR == 100, NR == 150' file.cfg
The alias I want to make should work like this(I guess):
<alias_command> <file.cfg><start_line><end_line>
So the... (1 Reply)
I have an awk file where I need to pass a filename and a value as a parameter from a sh script. I need to know how to pass those values in the sh script and how to use the same in the awk file.
Thanks in advance!!!
Geetha (3 Replies)
Hello
I've got a script that takes 2 parameters. id and f.
id is a user id and f is a file.
I want to print this id on the first line and then the file.
how can this be done?
thanks (3 Replies)
Hi
I have to change some TCP settings in Solaris10 machine running on AMD. Is there any tool or GUI to do this. I want to see if there is any easy way to put them in the startup scripts.
Thanks (1 Reply)