DILEEP410,
Thanks for your reply,
For the output, I need only city names and then I will use them to store in database.
like CITY1=Washington,CITY2= ...,
could some one tell me, how could i pass the wilcard notation given as input to variable $1 which acts as variable that matches files in the directory and the delete them.
Hello,
ranjithpr,snowline and ghostdog74,
Thank you for your reply.I will try to implement soon.
Also,it looks like I was not clear ,here is the really scenario:
text file
A:Washington,B:Paris,D:London,C:Cape Town,E:Copenhagen,F:Mumbai
The problem is on this part here:
CITY1:`echo "$text" | grep "A:" |awk '{print $0 }'`
CITY2:`echo "$text" | grep "B:" |awk '{print $0 }'`
CITY3:`echo "$text" | grep "C:" |awk '{print $0 }'`
CITY4:`echo "$text" | grep "D:" |awk '{print $0 }'`
CITY5:`echo "$text" | grep "E:" |awk '{print $0 }'`
CITY6:`echo "$text" | grep "F:" |awk '{print $0 }'`
if [ "$SQL_PASSWORD" != "" ]; then
SQL_ARGS="-p$SQL_PASSWORD";
else
SQL_ARGS="";
fi
SQL_ARGS="-h $SQL_HOST -u $SQL_USER $SQL_ARGS -D $SQL_DATABASE -s -e"
mysql $SQL_ARGS " insert into $SQL_TABLE(city1,city2,city3,city4,city5,city6) values
(\"CITY1\",\"$CITY2\",\"$CITY3\",\"$CITY4\",\"$CITY5\",\"$CITY6");";
I came across a data extraction software that works well on windows, i got it from mountonetech.com, see if they have similar data extraction software for unix environment.