468,316 Members | 2,115 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,316 developers. It's quick & easy.

probles with space between two words, HTML

19
Hello,

I have one weather.txt file:

city weatther

Amsterdam mostly cloudy
Zagreb havy reain

...

I am using this code to convert it ti html and add table:

cat weather.txt |awk 'BEGIN { print "<html>"
print "<table BORDER=2>"}
{ print "<tr>"
print "<td>"
print $1
print "</td>"
print "<td>"
print $2
print "</td>"
print "<td>"
print $3
print "</td>"
print "<td>"
print $4
print "</td>"
print "<td>"
print $5
print "</td>"
print "<td>"
print $6
print "</td>"
print "<td>"
print $7
print "</td>"
print "<td>"
print $8
print "</td>"
print "<tr>"
print "</html>"}

END { print "</table>"
print "</html>"}'
Problem is: if I have space between words it separate it to two colimns or two rows, but I wont to have it in column or row. How can I solve this problem?

Thenks a lot
Mar 10 '08 #1
1 2096
drhowarddrfine
7,435 Expert 4TB
Are you saying awk is creating a new cell for the second word when there is a space? In that case, you need to ask how to change that on the Unix forum.
Mar 10 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Philipp Lenssen | last post: by
7 posts views Thread by ms_chika | last post: by
8 posts views Thread by Joseph | last post: by
12 posts views Thread by JA | last post: by
4 posts views Thread by Don Miller | last post: by
15 posts views Thread by Spiros Bousbouras | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.