Python Forum
Select specific zone in .txt file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select specific zone in .txt file
#1
Hello everyone !!

I have a very large number of .txt files that all have the same structure (only numerical values are different) and are all in the same folder :

Name = [102, 22]_[152, 32]_1_1_1
Mach = 0; Re = 2000000; T.U. = 1.0; T.L. = 1.0
Surface Finish = 0; Stall model = 0; Transition model = 1; Aspect Ratio = 0; ground effect = 0
?	Cl	Cd	Cm 0.25	T.U.	T.L.	S.U.	S.L.	L/D	A.C.	C.P.
[°]	[-]	[-]	[-]	[-]	[-]	[-]	[-]	[-]	[-]	[-]
0.0	-2.868	0.02003	1.113	1.521	1.772	1.523	1.963	-143.170	0.250	0.638
The only value I am interested in is Cl (-2.868 here).

Since all files have the same structure, that all Cl values are negative with the same number of digits, they are therefore always at the same location.

I'd like to browse all .txt file from my folder and extract the Cl value in each of them in order to write it in a new .txt file (in which at the end all Cl values will be written).

Is it possible and if yes how can I do it ?
Thanks in advance for your help,
Scientifix
Reply


Messages In This Thread
Select specific zone in .txt file - by Scientifix - Apr-27-2018, 06:30 PM
RE: Select specific zone in .txt file - by j.crater - Apr-27-2018, 06:47 PM
RE: Select specific zone in .txt file - by j.crater - Apr-27-2018, 08:03 PM
RE: Select specific zone in .txt file - by nilamo - Apr-27-2018, 08:23 PM
RE: Select specific zone in .txt file - by snippsat - Apr-28-2018, 02:10 PM
RE: Select specific zone in .txt file - by nilamo - Apr-28-2018, 09:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting specific file from an archive tester_V 4 573 Jan-29-2024, 06:41 PM
Last Post: tester_V
  Downloading time zone aware files, getting wrong files(by date))s tester_V 9 1,110 Jul-23-2023, 08:32 AM
Last Post: deanhystad
  Reading Specific Rows In a CSV File finndude 3 1,023 Dec-13-2022, 03:19 PM
Last Post: finndude
  How to extract specific data from .SRC (note pad file) Shinny_Shin 2 1,302 Jul-27-2022, 12:31 PM
Last Post: Larz60+
  select files such as text file RolanRoll 2 1,208 Jun-25-2022, 08:07 PM
Last Post: RolanRoll
  Extracting Specific Lines from text file based on content. jokerfmj 8 3,127 Mar-28-2022, 03:38 PM
Last Post: snippsat
  [Solved] Trying to read specific lines from a file Laplace12 7 3,622 Jun-21-2021, 11:15 AM
Last Post: Laplace12
  Extract specific sentences from text file Bubly 3 3,476 May-31-2021, 06:55 PM
Last Post: Larz60+
  Subprocesses not opening File Select Dialog teut 2 2,449 Feb-22-2021, 08:07 PM
Last Post: teut
  Find specific file in an archive tester_V 8 3,554 Feb-13-2021, 06:13 PM
Last Post: tester_V

Forum Jump:

User Panel Messages

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