Hi,
I need to create a report in unix by moving to specified lines and specified positions and print some strings etc..
for eg: i need to print a string on 15th line and 7th position of a file.
Please suggest.
Thanks,
Mohan
Hi,
I need to create a report in unix by moving to specified lines and specified positions and print some strings etc..
for eg: i need to print a string on 15th line and 7th position of a file.
Please suggest.
Thanks,
Mohan
if your "positions" are by space delimited fields, with bash
#!/bin/bash
i=1
while read -r a b c d e f g h
do
if [ "$i" -eq 15 ];then
echo "$g"
fi
i=$((i+1))
done < file
cat urfile| sed -n 15p |awk '{print $7}'
awk 'NR==15{print $7}' file