Python Forum
[SOLVED] Delete specific characters from string lines
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Delete specific characters from string lines
#1
Question 
[Solved]
I have this file right here, which is an extract of a much bigger file.

Quote:CSCIR, 30, 0, 0
CSYS, 0
MAT , 2306
TYPE, 2741
REAL, 2749
NBLOCK,6,SOLID, 1574331, 390115
(3i9,6e21.13e3) EUREKA
1163065 0 0 1.2309330490000E+001 1.4094185190000E+002-2.6164289660000E+000
1163066 0 0 1.6908245310000E+001 1.3347532020000E+002-3.5939584870000E+000
1163067 0 0 1.8897693910000E+001 1.3494341620000E+002-4.0168288420000E+000
1163068 0 0 1.4443393310000E+001 1.4091121090000E+002-3.0700380210000E+000
1163069 0 0 1.4714475250000E+001 1.3618873440000E+002-3.1276582650000E+000
1163070 0 0 1.7605477220000E+001 1.3609469910000E+002-3.7421597040000E+000
1163071 0 0 1.2177877690000E+001 1.4552741340000E+002-2.5884878110000E+000
1163072 0 0 1.2254404380000E+001 1.4326778460000E+002-2.6047540600000E+000

I already made code for Python to detect the starting point thanks to help from this forum (thanks a lot btw, advice worked wonders).
(EUREKA) marks this starting point.
Now I simply want to remove one 0 after E+ in every instance.

Example:

1163065 0 0 1.2309330490000E+001 1.4094185190000E+002-2.6164289660000E+000
becomes
1163065 0 0 1.2309330490000E+01 1.4094185190000E+02-2.6164289660000E+00
Reply


Messages In This Thread
[SOLVED] Delete specific characters from string lines - by EnfantNicolas - Oct-21-2021, 09:38 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  delete specific row of entries jacksfrustration 3 392 Feb-13-2024, 11:13 PM
Last Post: deanhystad
  doing string split with 2 or more split characters Skaperen 22 2,520 Aug-13-2023, 01:57 AM
Last Post: Skaperen
  How do I check if the first X characters of a string are numbers? FirstBornAlbratross 6 1,530 Apr-12-2023, 10:39 AM
Last Post: jefsummers
  [SOLVED] [BeautifulSoup] Why does it turn inserted string's brackets into </>? Winfried 0 1,522 Sep-03-2022, 11:21 PM
Last Post: Winfried
  [SOLVED] [BeautifulSoup] Turn select() into comma-separated string? Winfried 0 1,119 Aug-19-2022, 08:07 PM
Last Post: Winfried
  Pymysql delete specific rows in tableview stsxbel 2 1,089 Aug-18-2022, 09:50 AM
Last Post: ibreeden
  Adding string after every 3rd charater [SOLVED] AlphaInc 2 1,253 Jul-11-2022, 09:22 AM
Last Post: ibreeden
  Delete multiple lines from txt file Lky 6 2,296 Jul-10-2022, 12:09 PM
Last Post: jefsummers
  Delete empty text files [SOLVED] AlphaInc 5 1,567 Jul-09-2022, 02:15 PM
Last Post: DeaD_EyE
  Trying to delete rows above a specific datetime value cubangt 19 11,476 May-09-2022, 08:57 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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