472,949 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,949 software developers and data experts.

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 2188
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

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

Similar topics

7
by: Philipp Lenssen | last post by:
I would like to know what others do to prevent line-breaks, using &nbsp; For example, the guidelines for the company have certain words (like "Model XY", where "Model" and "XY" shouldn't be...
7
by: ms_chika | last post by:
hi to all! I just want to ask if how could i validate a text or string if it has a space between characters? Thanks in advance. *** Sent via Developersdex http://www.developersdex.com ***...
8
by: Joseph | last post by:
I have a textBox that people writes stories in it. They can use for format. I have Aspell installed on the server, so people can make correction to their text. Sometimes, they forget to add a...
12
by: JA | last post by:
Is there a way to remove all the white space in the fields? I have been using Find-and-replace - looking for 2 or 3 or 4 or 10 spaces and replacing them with none. I don't want to replace single...
4
by: asnowfall | last post by:
If I have white space in the <atag, IE interpretes it as line break. I tried setting "whie-space: pre" and it did not seem to affect. Here is a sample. ...
1
by: thermate | last post by:
diapers, wig, knife ... guys i am dying of laughter, someone help me ... Seems like the Neoconish spirit of Bush/Cheney has permeated the whole country thru the cell phones and cause the yanks...
4
by: Don Miller | last post by:
When an ASP.NET 2.0 web page is rendered with multiple web controls hidden from view (.visible=false) there is a noticeable gap between a rendered element (like a table) and the next visible...
4
by: Matsam | last post by:
Hi, I have a search page in which I take data from a recordset. Some data which is retrieved may have more than one space between 2 words. But in my result page, HTML is truncating those spaces...
15
by: Spiros Bousbouras | last post by:
I'm thinking of adding a command to vim for removing white space from the end of each line of a C source file. Can anyone think of a situation where such white space might be useful ?
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.