Python Forum
Python split and concatenate
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python split and concatenate
#2
decimal(10,0) - the comma is a problem

a short test with decimal(10.0)

#mylist = ["columnname:string,columnname1:int,columnname2:decimal(10,0),columnname3:decimal(9,2)"]
mylist = ["columnname:string,columnname1:int,columnname2:decimal(10.0),columnname3:decimal(9.2)"]
 
for a in ",".join(mylist).split(","):
    name = "%s%s" % ("col.", a.partition(":")[0]) 
    print(name)
Output:
col.columnname col.columnname1 col.columnname2 col.columnname3
Reply


Messages In This Thread
Python split and concatenate - by saravanatn - Jul-30-2018, 05:44 AM
RE: Python split and concatenate - by Axel_Erfurt - Jul-30-2018, 08:47 AM
RE: Python split and concatenate - by saravanatn - Jul-30-2018, 03:30 PM
RE: Python split and concatenate - by Axel_Erfurt - Jul-30-2018, 05:14 PM
RE: Python split and concatenate - by saravanatn - Jul-31-2018, 08:22 AM
RE: Python split and concatenate - by Axel_Erfurt - Jul-31-2018, 08:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Concatenate str JohnnyCoffee 2 2,965 May-01-2021, 03:58 PM
Last Post: JohnnyCoffee
  Concatenate two dataframes moralear27 2 1,914 Sep-15-2020, 08:04 AM
Last Post: moralear27
  can only concatenate str (not "int") to str gr3yali3n 6 4,169 May-28-2020, 07:20 AM
Last Post: pyzyx3qwerty
  Concatenate multiple PDFs using python gmehta1996 0 2,138 Mar-29-2020, 09:48 PM
Last Post: gmehta1996
  Concatenate two dictionaries harish 3 2,428 Oct-12-2019, 04:52 PM
Last Post: strngr12

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020