473,792 Members | 2,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

parsing question (replace)

Couple questions when parsing using replace.
I have the following text I am parsing:
$650
Number of Bedrooms 3
Air Conditioning? Yes
Original Ad SOUTH, 3BR, air, basement. $650. Call 278-4171.
First Appeared in the Newspaper
Thursday, October 30, 2003

$775
Number of Bedrooms 3
Number of Bathrooms 2
Type of Parking Garage
Street Address Cashel Ct
Original Ad . New 3BR,2BA, garage. $775. 229-6575
First Appeared in the Newspaper
Friday, October 31, 2003
Here is part of my code so far:
str=replace (s,"2003","<br> <br><br>")
str=replace(str ,"Number of Bedrooms","|")
str=replace(str ,"Number of Bathrooms","|")
str=replace(str ,"Original Ad","|")
str=replace(str ,"Type of Parking Garage","")
str=replace(str ,"Street Address","|")
str=replace(str ,"First Appeared in the Newspaper","|")
My intentions are to be able to import this information into a database,
so I need to same number of fields.
All I care about is # of bedrooms, # of baths,rent.
If you look at the 1st entry, there is no NUMBER OF BATHROOMS. How can I
put a blank in there anyway? I am delimiting by the pipe.

Any help is appreciated.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
0 1353

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2908
by: Terry | last post by:
Hi, This is a newbie's question. I want to preload 4 images and only when all 4 images has been loaded into browser's cache, I want to start a slideshow() function. If images are not completed loaded into cache, the slideshow doesn't look very nice. I am not sure how/when to call the slideshow() function to make sure it starts after the preload has been completed.
3
1220
by: Badri | last post by:
I have a program that runs as a windows service waking up at predefined intervals to send out mails. Each mail is based on a template with tags to replace with database data from that specific row (mail merge type of operation). Every so often the parsing is only half-done; but I’ve seen the parsing work fully some times. I was thinking it could be some kind of a memory problem (there are a lot of string manipulations in the code) but...
9
4063
by: ankitdesai | last post by:
I would like to parse a couple of tables within an individual player's SHTML page. For example, I would like to get the "Actual Pitching Statistics" and the "Translated Pitching Statistics" portions of Babe Ruth page (http://www.baseballprospectus.com/dt/ruthba01.shtml) and store that info in a CSV file. Also, I would like to do this for numerous players whose IDs I have stored in a text file (e.g.: cobbty01, ruthba01, speaktr01, etc.)....
24
2507
by: Marc Dubois | last post by:
hi, is it possible to parse an XML file in C so that i can fulfill these requirements : 1) replace all "<" and ">" signs inside the body of tag by a space, e.g. : Example 1: <fooblabla < bla </foo> becomes <fooblabla bla </foo>
2
4887
by: RG | last post by:
I am having trouble parsing the data I need from a Serial Port Buffer. I am sending info to a microcontroller that is being echoed back that I need to remove before I start the actual important data reading. For instance this is my buffer string: 012301234FFFFFFxFFFFFFxFFFFFFx Where the FFFFFF is my Hex data I need to read. I am using the "x" as a separater as I was having problems using the VbCrLf. But I think
3
4248
by: Phillip B Oldham | last post by:
Hi. I'm stretching my boundaries in programming with a little python shell-script which is going to loop through a list of domain names, grab the whois record, parse it, and put the results into a csv. I've got the results coming back fine, but since I have *no* experience with python I'm wondering what would be the preferred "pythonic" way of parsing the whois string into a csv record. Tips/thoughts/examples more than welcome!
0
1432
by: bruce | last post by:
Hi Fredrick Thanks for the reply. But since I don't have control of the initial text, is there something with python that will strip/replace this... or are you saying I should do a search/replace on the "&" char with the "amp&;" prior to parsing??
10
1998
by: len | last post by:
I have created the following program to read a text file which happens to be a cobol filed definition. The program then outputs to a file what is essentially a file which is a list definition which I can later copy and past into a python program. I will eventually expand the program to also output an SQL script to create a SQL file in MySQL The program still need a little work, it does not handle the following items
1
2966
by: hd95 | last post by:
In a perfect world my xml feed source would produce perfect xml ..that is not the case I am parsing an XML feed that sometimes has ampersands and dashes in the content that messes up my parsing. I've tried doing pre processing with find/replace to get rid of these characters but then I get another type of error "An unexpected end of file parsing CDATA has occurred" So to get around that error I've added in unicoding and removing...
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10159
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.