Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
replace text in a txt
#17
Quote:I don't see any value in putting this information in a database. A database needs to be carefully designed to be useful. If you could put this information into a database, what kind of queries would you want to perform? Use the queries to define what tables and columns you'll need in your database, then write the code to load the file into database tables. Don't create the tables first then try to figure out how to write a query.

is it possible to do searchs on the txt that has this structure?

Genoa - Juventus
26% (3.85)  1.11%   1
18% (5.56)  -1.11%   X
56% (1.79)  -1.11%   2
44% (2.27)  1.11%   1X
74% (1.35)  -1.11%   X2
82% (1.22)  1.11%   12
60% (1.67)  -11.11%   GOL
40% (2.50)  11.11%   NO GOL
96% (1.04)  -1%   OVER 0.5
82% (1.22)  -1.11%   OVER 1.5
58% (1.72)  1.11%   OVER 2.5
28% (3.57)  -1.11%   OVER 3.5
18% (5.56)  -1.11%   OVER 4.5
4% (25.00)  1%   UNDER 0.5
18% (5.56)  1.11%   UNDER 1.5
42% (2.38)  -1.11%   UNDER 2.5
72% (1.39)  1.11%   UNDER 3.5
82% (1.22)  1.11%   UNDER 4.5
66% (1.52)  -1.11%   SEGNA CASA
34% (2.94)  1.11%   SEGNA CASA OVER 1.5
12% (8.33)  -1.11%   SEGNA CASA OVER 2.5
66% (1.52)  -1.11%   SEGNA CASA UNDER 1.5
88% (1.14)  1.11%   SEGNA CASA UNDER 2.5
90% (1.11)  -11%   SEGNA OSPITE
50% (2.00)  -1.11%   SEGNA OSPITE OVER 1.5
24% (4.17)  1.11%   SEGNA OSPITE OVER 2.5
50% (2.00)  1.11%   SEGNA OSPITE UNDER 1.5
76% (1.32)  -1.11%   SEGNA OSPITE UNDER 2.5
24% (4.17)  -11.11%   1 PRIMO TEMPO
32% (3.13)  11.11%   X PRIMO TEMPO
44% (2.27)  -1.11%   2 PRIMO TEMPO
56% (1.79)  1.11%   1X PRIMO TEMPO
76% (1.32)  11.11%   X2 PRIMO TEMPO
68% (1.47)  -11.11%   12 PRIMO TEMPO
78% (1.28)  -11.11%   OVER 0.5 PRIMO TEMPO
36% (2.78)  -1.11%   OVER 1.5 PRIMO TEMPO
10% (10.00)  1.11%   OVER 2.5 PRIMO TEMPO
22% (4.55)  11.11%   UNDER 0.5 PRIMO TEMPO
64% (1.56)  1.11%   UNDER 1.5 PRIMO TEMPO
90% (1.11)  -1.11%   UNDER 2.5 PRIMO TEMPO
16% (6.25)  -1.11%   GOL PRIMO TEMPO
84% (1.19)  1.11%   NO GOL PRIMO TEMPO
18% (5.56)  -1.11%   1 SECONDO TEMPO
40% (2.50)  11%   X SECONDO TEMPO
42% (2.38)  -11.11%   2 SECONDO TEMPO
58% (1.72)  11.11%   1X SECONDO TEMPO
82% (1.22)  1.11%   X2 SECOND HALF
60% (1.67)  -11%   12 SECONDO TEMPO
78% (1.28)  -11%   OVER 0.5 SECONDO TEMPO
52% (1.92)  1.11%   OVER 1.5 SECONDO TEMPO
30% (3.33)  -1.11%   OVER 2.5 SECONDO TEMPO
22% (4.55)  11%   UNDER 0.5 SECONDO TEMPO
48% (2.08)  -1.11%   UNDER 1.5 SECONDO TEMPO
70% (1.43)  1.11%   UNDER 2.5 SECONDO TEMPO
40% (2.50)  1.11%   GOL SECONDO TEMPO
60% (1.67)  -1.11%   NO GOL SECONDO TEMPO
56% (1.79)  1.11%   DISPARI
44% (2.27)  -1.11%   PARI
54% (1.85)  -1.11%   MULTIGOL CASA 1-2
62% (1.61)  -1.11%   MULTIGOL CASA 1-3
30% (3.33)  11.11%   MULTIGOL CASA 2-3
66% (1.52)  -11.11%   MULTIGOL OSPITE 1-2
80% (1.25)  -1.11%   MULTIGOL OSPITE 1-3
40% (2.50)  1.11%   MULTIGOL OSPITE 2-3
38% (2.63)  -1.11%   MULTIGOL 1-2
68% (1.47)  1.11%   MULTIGOL 1-3
78% (1.28)  1.11%   MULTIGOL 1-4
86% (1.16)  -1.11%   MULTIGOL 1-5
92% (1.09)  1.11%   MULTIGOL 1-6
54% (1.85)  -1.11%   MULTIGOL 2-3
64% (1.56)  1.11%   MULTIGOL 2-4
72% (1.39)  -1.11%   MULTIGOL 2-5
78% (1.28)  -1.11%   MULTIGOL 2-6
40% (2.50)  11.11%   MULTIGOL 3-4
48% (2.08)  1.11%   MULTIGOL 3-5
54% (1.85)  1.11%   MULTIGOL 3-6
18% (5.56)  -1.11%   MULTIGOL 4-5
24% (4.17)  -1.11%   MULTIGOL 4-6
14% (7.14)  -1.11%   MULTIGOL 5-6
4% (25.00)  -1.11%   MULTIGOL 7-+
26% (3.85)  1.11%   1 + OVER 1.5
14% (7.14)  -1.11%   X + OVER 1.5
42% (2.38)  -11.11%   2 + OVER 1.5
20% (5.00)  1.11%   1 + OVER 2.5
4% (25.00)  1%   X + OVER 2.5
34% (2.94)  -1.11%   2 + OVER 2.5
10% (10.00)  -1.11%   1 + OVER 3.5
4% (25.00)  1%   X + OVER 3.5
14% (7.14)  -1.11%   2 + OVER 3.5
6% (16.67)  -1.11%   1 + OVER 4.5
2% (50.00)  1%   X + OVER 4.5
10% (10.00)  -1.11%   2 + OVER 4.5
40% (2.50)  1.11%   1X + OVER 1.5
56% (1.79)  -11.11%   X2 + OVER 1.5
68% (1.47)  -1.11%   12 + OVER 1.5
24% (4.17)  1.11%   1X + OVER 2.5
38% (2.63)  1.11%   X2 + OVER 2.5
54% (1.85)  -1.11%   12 + OVER 2.5
14% (7.14)  -1.11%   1X + OVER 3.5
18% (5.56)  -1.11%   X2 + OVER 3.5
24% (4.17)  -11.11%   12 + OVER 3.5
8% (12.50)  -1.11%   1X + OVER 4.5
12% (8.33)  -1.11%   X2 + OVER 4.5
16% (6.25)  -11.11%   12 + OVER 4.5
0% (NA)  1%   1 + UNDER 1.5
4% (25.00)  1%   X + UNDER 1.5
14% (7.14)  1.11%   2 + UNDER 1.5
6% (16.67)  1%   1 + UNDER 2.5
14% (7.14)  -1.11%   X + UNDER 2.5
22% (4.55)  -1.11%   2 + UNDER 2.5
16% (6.25)  11%   1 + UNDER 3.5
14% (7.14)  -1.11%   X + UNDER 3.5
42% (2.38)  -1.11%   2 + UNDER 3.5
20% (5.00)  11.11%   1 + UNDER 4.5
16% (6.25)  -1.11%   X + UNDER 4.5
46% (2.17)  1.11%   2 + UNDER 4.5
4% (25.00)  1%   1X + UNDER 1.5
18% (5.56)  1.11%   X2 + UNDER 1.5
14% (7.14)  1.11%   12 + UNDER 1.5
20% (5.00)  1.11%   1X + UNDER 2.5
36% (2.78)  -1.11%   X2 + UNDER 2.5
28% (3.57)  1.11%   12 + UNDER 2.5
30% (3.33)  11.11%   1X + UNDER 3.5
56% (1.79)  -1.11%   X2 + UNDER 3.5
58% (1.72)  11.11%   12 + UNDER 3.5
36% (2.78)  1.11%   1X + UNDER 4.5
62% (1.61)  -1.11%   X2 + UNDER 4.5
66% (1.52)  11.11%   12 + UNDER 4.5
20% (5.00)  1.11%   1 + GOL
14% (7.14)  -1.11%   X + GOL
26% (3.85)  -11.11%   2 + GOL
34% (2.94)  -1.11%   1X + GOL
40% (2.50)  -11.11%   X2 + GOL
46% (2.17)  -1.11%   12 + GOL
6% (16.67)  1%   1 + NO GOL
4% (25.00)  1%   X + NO GOL
30% (3.33)  1.11%   2 + NO GOL
10% (10.00)  11%   1X + NO GOL
34% (2.94)  1.11%   X2 + NO GOL
36% (2.78)  1.11%   12 + NO GOL
for example find all the % > 65 and odd the value in () > of 1,2 and put in output match and type ?
Reply


Messages In This Thread
replace text in a txt - by cartonics - Oct-12-2023, 07:50 AM
RE: replace text in a txt - by buran - Oct-12-2023, 07:52 AM
RE: replace text in a txt - by cartonics - Oct-12-2023, 08:01 AM
RE: replace text in a txt - by buran - Oct-12-2023, 09:11 AM
RE: replace text in a txt - by perfringo - Oct-12-2023, 09:43 AM
RE: replace text in a txt - by cartonics - Oct-12-2023, 10:54 AM
RE: replace text in a txt - by deanhystad - Oct-12-2023, 08:01 PM
RE: replace text in a txt - by cartonics - Oct-13-2023, 07:31 AM
RE: replace text in a txt - by deanhystad - Oct-13-2023, 11:35 AM
RE: replace text in a txt - by cartonics - Oct-13-2023, 12:48 PM
RE: replace text in a txt - by deanhystad - Oct-13-2023, 01:27 PM
RE: replace text in a txt - by cartonics - Oct-13-2023, 02:28 PM
RE: replace text in a txt - by deanhystad - Oct-13-2023, 06:35 PM
RE: replace text in a txt - by cartonics - Oct-13-2023, 08:01 PM
RE: replace text in a txt - by deanhystad - Oct-13-2023, 08:42 PM
RE: replace text in a txt - by cartonics - Oct-14-2023, 06:33 AM
RE: replace text in a txt - by nicoali - Dec-15-2023, 06:28 PM
RE: replace text in a txt - by nicoali - Dec-16-2023, 04:07 PM
RE: replace text in a txt - by logicielfr - Jan-23-2024, 09:33 PM
RE: replace text in a txt - by Athi - Jan-30-2024, 06:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Replace a text/word in docx file using Python Devan 4 3,895 Oct-17-2023, 06:03 PM
Last Post: Devan
  python-docx regex: replace any word in docx text Tmagpy 4 2,338 Jun-18-2022, 09:12 AM
Last Post: Tmagpy
  Replace String in multiple text-files [SOLVED] AlphaInc 5 8,296 Aug-08-2021, 04:59 PM
Last Post: Axel_Erfurt
  Iterate 2 large text files across lines and replace lines in second file medatib531 13 6,120 Aug-10-2020, 11:01 PM
Last Post: medatib531
  Search & Replace - Newlines Added After Replace dj99 3 3,466 Jul-22-2018, 01:42 PM
Last Post: buran
  Need to replace (remove) Unicode characters in text ineuw 1 8,663 Jan-02-2018, 08:01 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

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