Search Results

Search: Posts Made By: amyt1234
1,576
Posted By amyt1234
Sorry its not working. awk -F"\t"...
Sorry its not working.



awk -F"\t" '{for (i=2;i<=NF;i++) if (!$i) $i=0}1' OFS="\t" test
output

2015/08/04 00:00:00 171 730579 ...
1,576
Posted By amyt1234
Yes all the fields are numeric except first one...
Yes all the fields are numeric except first one which is date.

the file is tab delimited and actually a output from sql query.

some of the rows are null so u see more space between column where...
1,576
Posted By amyt1234
How to replace blank tab with zero in a file?
hi,

i need to replace a blank tab output in a file to zero.

input file:

2015/08/04 00:00:00 171 730579 27088 ...
2,849
Posted By amyt1234
can you explain what you want as output? you...
can you explain what you want as output?

you can assign simply

y=`echo $src1|awk 'BEGIN {FS=","} {for(i=1;i<=NF;i++) print $i}'`


but not sure what youu mean by variable in a loop
23,141
Posted By amyt1234
Sorry for not explaining correctly. ...
Sorry for not explaining correctly.


Suppose input is :

5 rows in a file with 4 column

2015/07/28 00:00:00 177 445370 ...
23,141
Posted By amyt1234
but i need to print column too at the same...
but i need to print column too at the same time....
your code will print all the column not specific columns...
23,141
Posted By amyt1234
How to print specific range using awk?
I want to print specific range of rows and then its columns using awk command.

lets say if a file contain 15 line then i need to print line 5 to 9.


awk '{print;for( NR>=5&&NR<=9); do; print ...
1,252
Posted By amyt1234
I got the answer. below is the code that...
I got the answer.

below is the code that worked for me.

for((i=0;i<15;i++))
do
if [ "${ZZZLAST_DATAIN_TIME[$i]}" -gt "${ZDATE_1[$i]}" ]
then
echo "YES"
else
echo "no"
fi
done
1,252
Posted By amyt1234
How to use if command to compare in an array?
Hi all,


Currently i am facing issue using if command to compare to array value.

can someone help me?

if [ "${ZZZLAST_DATAIN_TIME[$i]}" -gt "${ZDATE_1[$i]}" ]
then
do
echo "red"
else ...
9,916
Posted By amyt1234
this is not my homework....its is just i need to...
this is not my homework....its is just i need to learn few skills in unix.....i posted in in homework beacuse i dont get link to post in main forum......as i m new it will take some time for me to...
9,916
Posted By amyt1234
How to remove everything before 1st space in UNIX?
i need to remove all before 1st space

input :
206292
24436
1115 504
1115 1120793
1115 17453606
62931
547915
108924
305715
23541
19255
315727
1403954
369685...
Showing results 1 to 11 of 11

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