473,406 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 2196
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 ?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.