Search Results

Search: Posts Made By: NareshN
2,721
Posted By NareshN
Grep -C option not available
grep -C option is not availbale and i am using korn shell.

Even -C option in man grep is not showing..

Input file : test.txt

111
333
444
555
aaa
bbbb

Command :
grep -C1 555...
1,402
Posted By NareshN
Thanks a lot Scott. Ya I noticed the orginal...
Thanks a lot Scott.
Ya I noticed the orginal output and i wrongly typed into that.
Could you explain the command bit detail.. so it will useful if i get these type of scenarios to work next time.....
1,402
Posted By NareshN
[Solved] Compare column data in all the rows
Hi..

In the below sorted input file.. I am comparing the first 3 columns of data one by one row and it is a pipeline delimitter file..

AA|BB|CC|line1
AA|BB|CC|ine4
AA|BB|CC|line2...
2,068
Posted By NareshN
File transfer script
Hi,

I need a shell script to transfer a file from one server(unix box) to another server(windows box).
I have the details of the source and destination Ip's.

source path : /home/UNIX/server...
3,646
Posted By NareshN
am using OS : AIX exact length is 400 ...
am using OS : AIX
exact length is 400

sed: 0602-404 Function /^.\{400\}$/!p cannot be parsed.

The record has pipe line characters "|"

If the length 20 or 50 is working file. I think...
3,646
Posted By NareshN
the file contails wide characters and sed command...
the file contails wide characters and sed command failed "

Function ... cannot be parsed"


and

awk
command displays all the records
3,646
Posted By NareshN
Record length
Hi,

The record length may be differ in afile. I want to display the records if the record length is not equal to 50 using sed/awk command.

Thanks in Advance
1,619
Posted By NareshN
Try this for filename in `ls data*` do...
Try this


for filename in `ls data*`
do
echo "$filename \t `wc -l < $filename`"
done
6,208
Posted By NareshN
Pamu, Thanks.. its working as expected. I...
Pamu, Thanks.. its working as expected.

I was capturing data between 2.00 to 2.59 only not 3.00. I think this { print } is optional rite.
6,208
Posted By NareshN
this code is already working in production env. I...
this code is already working in production env. I just want to enhance this.
awk '/0[2-2]:[0-2][0-9]:[0-9][0-9]/ || /[0-0][2-2]:[0-9][0-9]:[0-9][0-9]/,/0[2-2]:[0-2][0-9]:[0-9][0-9]/
this is just...
6,208
Posted By NareshN
thanks pamu, but its not working. i need the...
thanks pamu,
but its not working.
i need the code something like


awk '{print $4}' filename | awk '/0[2-2]:[0-2][0-9]:[0-9][0-9]/ ||...
6,208
Posted By NareshN
i just want to apply a filter based on the 4th...
i just want to apply a filter based on the 4th column.
Forum: HP-UX 09-06-2012
28,837
Posted By NareshN
try this ls -lrt .jar* | awk '{print...
try this


ls -lrt .jar* | awk '{print $9,$5,$6,$7,$8}


Here $9 is filesize, $5 is filesize and $6,7,8 is filedate
6,208
Posted By NareshN
Something requirement related to above query, ...
Something requirement related to above query,

i have a data like this


Thu Sep 6 02:15:54 2012->ABCServ(603):$Id: ABCServ.c,v 1.3 2006/08/24 20:52:17 rkaps
Thu Sep 6 02:20:12...
1,362
Posted By NareshN
elixir, Thank you so much its working. ...
elixir,

Thank you so much its working.
Could you please explain the command for my understanding

sed '/ContactAddress/,/Restarts/{
/Restarts/s/[0-9][0-9]*/500/
}' file



Is it...
1,362
Posted By NareshN
elixir, Thanks for your quick reply. ...
elixir,
Thanks for your quick reply.

value column may be a string also. how can i achieve this.

And one more thing, the search value(1000 or some string) and replace value(500 or a string)...
1,362
Posted By NareshN
start searching a word from the particular record on the result of first occurence change the value
Hi,
I need a script to start searching a word from the particular record on the result of first occurence i need to change the value in that record.

I have a input file like this

...
6,208
Posted By NareshN
Scrutinizer, It's getting some error if i...
Scrutinizer,

It's getting some error if i execute the above command.

awk: syntax error near line 1
awk: bailing out near line 1
6,208
Posted By NareshN
Could you plz help how to pass the parameters to...
Could you plz help how to pass the parameters to awk
6,208
Posted By NareshN
Scrutinizer, Could you plz explain the command....
Scrutinizer,
Could you plz explain the command. I didn't understand.
Is it will work for huge data file.
Is it possible, by using grep

---------- Post updated at 05:44 PM ---------- Previous...
6,208
Posted By NareshN
The problem is i dont know the next record to...
The problem is i dont know the next record to delete in the file (may be GGG or ZZZ). In that case how can we use destination string.
1,481
Posted By NareshN
Display records between two search strings using sed
I have input file like
AAA
AAA
CCC
CCC
CCC
EEE
EEE
EEE
EEE
FFF
FFF
GGG
GGG
i was trying to retrieve data between two strings using sed.
sed -n /CCC/,/FFF/p input_file
Am getting...
6,208
Posted By NareshN
retrieving data between two strings
I have input file like
AAA
AAA
CCC
CCC
CCC
EEE
EEE
EEE
EEE
FFF
FFF
GGG
GGG
i was trying to retrieve data between two strings using sed.
sed -n /CCC/,/FFF/p input_file
Am getting...
2,321
Posted By NareshN
Try this... ls -l *.csv | awk '{print $9}'...
Try this...

ls -l *.csv | awk '{print $9}' > csvfiles.txt
cat csvfiles.txt | while read LINE
do
sed 's/oldstring/newstring/g' $LINE > $LINE.txt
mv $LINE.txt $LINE
done
1,717
Posted By NareshN
I found out the problem... paste -sd+...
I found out the problem...

paste -sd+ filename | bc

The ablove code is working only for 350 records, to take sum up values inside a file. Performance wise, it will execute very fast. If it...
Showing results 1 to 25 of 33

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