|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Text manipulation
Hi ,
i am new in python enviromnet and i wonder if there exist any ' high level ' command to find columns separated by blank delimeters in an text document read by python, like it exists in awk in Unix for example, except the old-fashioned and low level use of 'for' command to determine that. thanks in advance for any help, Nikos |
|
#2
|
|||
|
|||
|
Python does not do it automatically like awk does, but you can do it yourself using the string split() method:
Code:
>>> s = " a string with spaces in it... " >>> s.split() ['a', 'string', 'with', 'spaces', 'in', 'it...'] >>> Dave - The Developers' Coach |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Text manipulation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|