Search Results

Search: Posts Made By: av_vinay
26,032
Posted By av_vinay
Thanks for your help. nawk version of the...
Thanks for your help.
nawk version of the script worked for me.

Thanks once again.:) :b:

---------- Post updated at 03:31 AM ---------- Previous update was at 02:43 AM ----------

Hi.,
...
26,032
Posted By av_vinay
I tried with the cut option, with which I am able...
I tried with the cut option, with which I am able to extract first date field, but it is not extracting time string as in :


dateStr=$(echo name_abc_20100531_142528.txt | cut -d_ -f3)
...
26,032
Posted By av_vinay
How to extract timestamp from the filename?
Hi.,

My file name is of the format:

name_abc_20100531_142528.txt
where.,

my timestamp is of the format:
yyyymmdd_hhmmss

How to extract the date strring and time string into...
3,417
Posted By av_vinay
Thanks guys. The script is working fine:b: :)
Thanks guys. The script is working fine:b: :)
3,417
Posted By av_vinay
How to check the varying file size
How to know a file is of fixed file or not over a span of time Actually my requirement is to check the size of the file in a specific directory for 60 seconds, and if it remains the same then I have...
4,879
Posted By av_vinay
Hi all., I am facing problem using awk with...
Hi all.,

I am facing problem using awk with its associated functions.
So I tried with sed command and it worket for me.

Here is the working script:


#!/bin/bash

echo "Enter input...
4,879
Posted By av_vinay
Ya., I tried with the things, but again it...
Ya.,

I tried with the things, but again it is resulting in the same error:

awk: syntax error near line 1
awk: bailing out near line 1
awk: syntax error near line 1
awk: bailing out near line...
4,879
Posted By av_vinay
Hi., nawk -F "|"...
Hi.,



nawk -F "|" '{gsub("004","IND",$2)}1' OFS="|" p.txt

It is resulting in output:



av|IND|adkf|Kent,004|s
av|005|ssdf|Kd,IT park|s


And also as per my i/p file, is there any...
4,879
Posted By av_vinay
Hi., nawk -F\| '{gsub("004","IND",$2)}1'...
Hi.,

nawk -F\| '{gsub("004","IND",$2)}1' p.txt

The above command is successfully replacing the code, but it is taking out the seperator away from the file.

It is resulting in :

av IND...
4,879
Posted By av_vinay
Hi., $ awk -F\| '{gsub("004","IND",$2)}1'...
Hi.,

$ awk -F\| '{gsub("004","IND",$2)}1' p.txt


I tried with the above command, but I got this as the error, when I executed in shell:




awk: syntax error near line 1
awk:...
4,879
Posted By av_vinay
Problem facing in using awk command
Hi.,

I am not able to replace the string with another string using gsub fn of awk command.

My code:


awk 'BEGIN gsub([^|]004,IND,004)' p.txt


and my i/p file p.txt is of the...
2,600
Posted By av_vinay
Thanks for providing me the solution in arriving...
Thanks for providing me the solution in arriving at the desired output.
I got the correct output.

As I don't have much exp. in Shell scripting, I just want to know what this line of code does in...
2,600
Posted By av_vinay
Here is the revised code, formatted: ...
Here is the revised code, formatted:


#!/bin/bash

#TFILE="/tmp/vinay/testb_1.txt"

while read line
do
aline="$line"
echo $aline
code=`echo $aline|cut -d ',' -f1`
...
2,600
Posted By av_vinay
Problem iterating in while loop
I am facing a problem in replacing the file contents by iterating through the list.

My present code:



Code:
#!/bin/bash#

TFILE="/tmp/vinay/testb_1.txt"
while read linedo ...
3,236
Posted By av_vinay
I hav tried with seperate script with...
I hav tried with seperate script with #!/bin/bash, it worked fine.

But I am facing a problem in replacing the file contents by iterating through the list.

My present code:

#!/bin/bash
...
3,236
Posted By av_vinay
I tried with the sample script provided. The same...
I tried with the sample script provided. The same error I am getting as an output. ..

$ ./rr.sh
./rr.sh: syntax error at line 8: `i=$' unexpected

And also in your reply, you said about "...
3,236
Posted By av_vinay
I tried with the above syntax, still it is...
I tried with the above syntax,

still it is throwing the error:

./run1.sh: syntax error at line 44: `i=$' unexpected


Regards.,
3,236
Posted By av_vinay
Facing problem in incrementing the variable
When I did,
echo $SHELL in cmd prompt of putty,
its displaying /bin/sh

And in my shell script.,

I hav started with.,
#!/bin/sh

and

i=1;

while [ $i -lt $VAR ] ;
do
.
.
....
6,317
Posted By av_vinay
Formatting the text file using shell script
How to add the filename to end of each line with | as seperator, except first and last line of the file(s) in directories(with diff tree structure) using shell script?. And also how to replace a list...
Showing results 1 to 19 of 19

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