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

Home Posts Topics Members FAQ

split string in multiple lines

5 New Member
PV_drivers_vers ion::((xenvbd 1.0boot) (xennet 4.0) (major 5) (minor 6) (micro 100) (build 47101))
i want o/p as:

PV_drivers_vers ion::
(xenvbd 1.0boot)
(xennet 4.0)
(major 5)
like thiz
thanks in advance.......
Jul 6 '12 #1
4 2674
ariful alam
185 New Member
To split a string you need a common character that used to split the string like ',',':',';' etc. in yous string it may be like following:
PV_drivers_vers ion::;((xenvbd 1.0boot); (xennet 4.0); (major 5); (minor 6);
Jul 7 '12 #2
muralimunna
5 New Member
ya excatly....my string was like vat u said....
nd i want the o/p as
PV_drivers_vers ion::
(xenvbd 1.0boot)
(xennet 4.0)
(major 5)
Jul 9 '12 #3
muralimunna
5 New Member
this is the string
Expand|Select|Wrap|Line Numbers
  1. row ref="OpaqueRef:b0147930-b9aa-2d95-0b0a-52d589c7520d" last_updated="20120514T13:04:01Z" disks="()" other_config="()" uuid="74d06017-78ea-8dab-3ed7-457869aea112" other="(('platform-feature-multiprocessor-suspend' '1') ('feature-balloon' '1') ('balloon-active' '0') ('feature-suspend' '1') ('feature-shutdown' '1') ('feature-rexec' '1') ('feature-ts' '1'))" PV_drivers_up_to_date="true" PV_drivers_version="(('xenvbd' '1.0boot') ('xennet' '4.0') ('major' '5') ('minor' '6') ('micro' '100') ('build' '47101'))" os_version="(('name' 'Microsoft Windows Server 2008 R2 Standard |C:\\Windows|\\Device\\Harddisk0\\Partition2') ('distro' 'windows') ('major' '6') ('minor' '1') ('spmajor' '1') ('spminor' '0'))" networks="(('0/ip' '192.168.41.140'))" memory="()" live="true" _ref="OpaqueRef:b0147930-b9aa-2d95-0b0a-52d589c7520d" /> 
hw can u print this as :
Expand|Select|Wrap|Line Numbers
  1. row ref =
  2. uuid =
  3. PV drivers =
  4. (xenvbd 1.0boot)
  5. (xennet 4.0)
  6. (major 5)
like tat
plz help me
Jul 9 '12 #4
ariful alam
185 New Member
See I am not a python coder, so I can't explain you how to split string in python. but it is true that to split a string you have to use split() function. here are some link on how to split a string:

Split a string

oreilly example

hacksparrow example

Hope these are help you. :)
Jul 9 '12 #5

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

Similar topics

5
31176
by: Stu Cazzo | last post by:
I have the following: String myStringArray; String myString = "98 99 100"; I want to split up myString and put it into myStringArray. If I use this: myStringArray = myString.split(" "); it will split myString up using the delimiter of 1 space so that
5
4542
by: MDB | last post by:
Hello all, I have having problems figuring out how to split on a string rather than a char. Any help would be appreciated. Here is what I am trying to do. string strMessages=sData.Split("\r\n"); I basically want to split on a new line.
4
8872
by: tshad | last post by:
I have a textbox that I am storing as text (or as a varChar). The field has multiple lines in it (not wrapped). When I read it back into a multiline textbox, it works fine. But when I read it back into a label, it shows all lines together. Is there a way to get the Label to display the lines separately? I could use textbox and get rid of the border and set enable to false, but then it greys the text, which I don't want.
2
2237
by: George | last post by:
Dear colleagues, I refer to your help with specific graphic problem. It is necessary to create a viewfinder in graphic application. It seems that the algorithm is simple: just draw lines in specific position in according to value of some controls, track bars, for example. Next read the track bars value to find the coordinates of lines cross. It works, but I can not get real cross because the background image is being deface by lines...
2
5079
by: daftspaniel | last post by:
Hi Folks, I am trying to scan the lines in the string text: lines = text.split('\n') seemed to do the job but has the side effect of stripping the whitespace. As I am reading Python source in this text and checking identation this is a bit annoying :-) How can I stop this happening? Doesn't look like an option from the
28
8185
by: Sriram Rajagopalan | last post by:
Hi, I was interested to know if there is a way to use a variable name split across multiple lines in C. For example : int this_is_a_very_long_variable_name = 10; I would like to split the "this_is_a_very_long_variable_name " into 2
1
2912
by: Andrus | last post by:
I have long single line string literals containing " characters in code like switch (expr) { case @"IR(""xxx"")+sql('sele tasudok from dok x where doktyyp+str(dokumnr,7)= ""G""+str(dok.krdokumnr,7) ','')": For code readability I need to split them to multiple lines so that vlaue remains same. I tried
2
7275
by: PengYu.UT | last post by:
Hi, In python, triple quote (""") can be used to quote a paragraph (multiple lines). I'm wondering if there is any equivalent in C++. For the following code, I could write the long string in a single line with "\n" in the middle, or I could use multiple cout and endl. But I just feel more readable if I can have the whole paragraph as a string. Thanks,
0
940
by: Andy B | last post by:
I use a Menu control at the top of my website ona master page. It is set to go across the top of the page. Is there a way that you can split the controls display up between multiple lines and still make it look good>?
0
8685
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
8880
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
7743
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...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
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
4373
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
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
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.