Python Forum
How to create new line '/n' at each delimiter in a string?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create new line '/n' at each delimiter in a string?
#1
I want python to automatically import a new line, or /n code at each delimiter within a string. Lets say I want Python to make a new line at every 'period' it sees within the string...WITHOUT typing out the /n myself (I want Python to automatically import the new line)

Lets say I have a string

Quote:'I want to be a developer. I also want to learn AWS. I am going to practice joining strings.'

And at each period within the string, I want Python to create a new line, so it reads like this:

Quote:'I want to be a developer.
I also want to learn AWS.
I am going to practice joining strings.'

I know the split function can split the string, but I cant figure out how to import the /n code into each delimiter, or how to import new lines in python without coding it. How can I do this automatically rather than manually adding a /n to each line?
Reply


Messages In This Thread
How to create new line '/n' at each delimiter in a string? - by MikeAW2010 - Dec-14-2020, 10:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python Read each xlsx file and write it into csv with pipe delimiter mg24 4 1,309 Nov-09-2023, 10:56 AM
Last Post: mg24
  Context-sensitive delimiter ZZTurn 9 1,394 May-16-2023, 07:31 AM
Last Post: Gribouillis
  Read csv file with inconsistent delimiter gracenz 2 1,140 Mar-27-2023, 08:59 PM
Last Post: deanhystad
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 12,392 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  Create Excel Line Chart Programmatically dee 3 1,143 Dec-30-2022, 08:44 PM
Last Post: dee
  Writing string to file results in one character per line RB76SFJPsJJDu3bMnwYM 4 1,306 Sep-27-2022, 01:38 PM
Last Post: buran
  Inserting line feeds and comments into a beautifulsoup string arbiel 1 1,145 Jul-20-2022, 09:05 AM
Last Post: arbiel
  Delimiter issue with a CSV file jehoshua 1 1,218 Apr-19-2022, 01:28 AM
Last Post: jehoshua
  Python code to read second line from CSV files and create a master CSV file sh1704 1 2,353 Feb-13-2022, 07:13 PM
Last Post: menator01
  append a string to a modified line Mr_Blue 10 3,731 Sep-16-2021, 07:24 PM
Last Post: Mr_Blue

Forum Jump:

User Panel Messages

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