Search Results

Search: Posts Made By: Gautham
3,253
Posted By Gautham
okay.. even the following might work: ...
okay..

even the following might work:

awk '$0~pat {n=NR+5} NR!=n' pat='10000' $1 > $2
mv -i $2 $1


and running the above by:

sh script_name file_name tmp_file_name


Right ?
3,253
Posted By Gautham
I was trying to do this to all files ending with...
I was trying to do this to all files ending with .txt in my destination directory using the following code :

cd /my_destination_dir/

for i in `ls *.txt`
do
awk '$0 ~ pat {n=NR+5} NR!=n'...
3,253
Posted By Gautham
I found a flaw in that 'awk' code.. lets say...
I found a flaw in that 'awk' code..

lets say file as c.txt :

10000
a
b
c
d
e
..
10000
a
b
c
d
e
..
.
It works fine for the above file as the first set of data is that of same...
3,253
Posted By Gautham
Thanks. it works cool. isn't that possible...
Thanks. it works cool.

isn't that possible with sed ?
3,253
Posted By Gautham
Deleting specific lines from text file via scripting
Hi,

I'm trying to search for some number and from that line, i need to delete the 5th line exactly.

Eg:
Consider below as text file data:

10000
a
b
c
d
e
.
.
.
10000
w
q
t
Showing results 1 to 5 of 5

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