473,699 Members | 2,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to convert markup text to plain text in python

5 New Member
i had string like thiz:

PV_drivers_up_t o_date::true
('name' 'Microsoft Windows Server 2008 R2 Standard |C:\\Windows|\\ Device\\Harddis k0\\Partition2' 'distro' 'windows''major ' '6''minor' '1''spmajor' '1''spminor' '0'
i want to print without '',\\ and :

please help me.
Jul 4 '12 #1
2 2277
bvdet
2,851 Recognized Expert Moderator Specialist
Use str replace method to replace unwanted characters with another such as a space or empty ("").
Expand|Select|Wrap|Line Numbers
  1. >>> print "'distro' 'windows''major' '6''minor'".replace("'", "")
  2. distro windowsmajor 6minor
  3. >>> 
Jul 4 '12 #2
muralimunna
5 New Member
thank fr giving solution....
can please help me how to get the entrie txt has plain txt
iwant output as:-
name Microsoft Windows Server 2008 R2 Standard C Windows Device Harddisk0 Partition2 dist ro windows major 6 minor 1 spmajor 1 spminor 0
Jul 5 '12 #3

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

Similar topics

3
8674
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo field in plain text. That's because I truncate the string text but if, when I truncate it there's a rich tag the code following the truncated string is corrupted. Don't know if it's clear enough.
10
4189
by: J. Alan Rueckgauer | last post by:
Hello. I'm looking for a simple way to do the following: We have a database that serves-up content to a website. Some of those items are events, some are news articles. They're stored in the DB as formatted HTML so ASP just drops them right into a page shell. Now, we want to send out a newsletter email containing some of those items. No problem sending as HTML. However, some of the members want just plain text. Is there some magic...
58
4671
by: Jeff_Relf | last post by:
Hi Tom, You showed: << private const string PHONE_LIST = "495.1000__424.1111___(206)564-5555_1.800.325.3333"; static void Main( string args ) { foreach (string phoneNumber in Regex.Split (PHONE_LIST, "_+")) { Console.WriteLine (phoneNumber); } } Output: 495.1000
1
12921
by: rob.kellington at gmail | last post by:
Does anyone have the logic to convert RTF formatted data in a text column into plain ascii text that I can use in a varchar variable or field? We have an app that allows formatted comments/notes to be stored in a SQL 2000 text column. Ideally, I would like a trigger that would copy any inserted comments into a seperate table, varchar field so that these are viewable in other apps that can not display formatted RTF. I would really...
4
17841
by: Ted | last post by:
I have a SQL Server 2000 table with a few fields of "text" data type that contain rich text. I have to downstream this data and the recipient cannot handle rich text. I need to figure out a way to convert it back to plain text. Any suggetions? TIA
8
3055
by: Doominato | last post by:
good day, I was just wondering how can I download a web page as plain text from a certain web site. I have tried to use the OpenURL() method from INET control in my VB.NET app, but it returns elements such as this <BR> within the plain text. Is there a way to filter them or to simply download the page as plain text? any help would be greatly appreciated.
2
1446
by: xitij9 | last post by:
I am using richtextbox control but I save data in richtext format and text format. I am just passing rtf to my business layer. Is there anyway I can convert rtf into plain text format. Thanks in advance xitij
1
6133
by: ting ting | last post by:
How can I convert rtf format to plain text format in Visual Studio 2005 using VB.net 2.0? rtf sample: {\rtf1\ansi\ansicpg950\deff0\deflang1033\deflangfe1028{\fonttbl{\f0\fnil\fcharset0 Arial;}} \viewkind4\uc1\pard\lang1028\fs24 gffjdyjkghjkj\par } Please help, THX!
8
6183
by: geoffbache | last post by:
I have some marked up text and would like to convert it to plain text, by simply removing all the tags. Of course I can do it from first principles but I felt that among all Python's markup tools there must be something that would do this simply, without having to create an XML parser etc. I've looked around a bit but failed to find anything, any tips? (e.g. convert "<B>Today</Bis <U>Friday</U>" to "Today is Friday")
2
1622
by: Ambika1 | last post by:
I need to convert HTMl into plain text output in vb.net. Can anyone please tell me how can I transform HTML into plain text with an example. Thanks
0
8686
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...
0
8615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9173
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9033
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8911
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
8882
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
7748
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4375
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
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.