Python Forum
[Solved] Reading every nth line into a column from txt file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Reading every nth line into a column from txt file
#3
(Jun-28-2021, 10:54 AM)snippsat Wrote: How dos the original file look it's properly a better way,but can not advice anything without a sample of original file.

Hey, it looks like this:

#0
0.4000 0.1250 2.0446
['Fixed', 'Fixed', '0.0339']
69.2721 9.6726 21.0553
['1.0359', '0.8128', '0.4063']
41.5603
['0.0588', ' ', ' ']
#1
0.4000 0.1250 2.0714
['Fixed', 'Fixed', '0.0344']
70.0338 9.0952 20.8710
['1.0308', '0.8135', '0.4009']
41.5853
['0.0593', ' ', ' ']
#2
0.4000 0.1250 2.0568
['Fixed', 'Fixed', '0.0333']
69.5963 8.7445 21.6592
['1.0411', '0.8177', '0.4072']
41.5541
['0.0603', ' ', ' ']
#3
0.4000 0.1250 2.0321
['Fixed', 'Fixed', '0.0329']
...
With 490 lines in total.
Reply


Messages In This Thread
RE: Reading every nth line into a column from txt file - by Laplace12 - Jun-28-2021, 12:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [SOLVED] Correct way to convert file from cp-1252 to utf-8? Winfried 8 1,341 Feb-29-2024, 12:30 AM
Last Post: Winfried
  Reading and storing a line of output from pexpect child eagerissac 1 4,424 Feb-20-2024, 05:51 AM
Last Post: ayoshittu
  Help copying a column from a csv to another file with some extras g0nz0uk 3 544 Feb-01-2024, 03:12 PM
Last Post: DeaD_EyE
Sad problems with reading csv file. MassiJames 3 776 Nov-16-2023, 03:41 PM
Last Post: snippsat
  Reading in of line not working? garynewport 2 948 Sep-19-2023, 02:22 PM
Last Post: snippsat
  Reading a file name fron a folder on my desktop Fiona 4 1,048 Aug-23-2023, 11:11 AM
Last Post: Axel_Erfurt
  [SOLVED] [Windows] Fails reading strings with accents Winfried 1 897 Apr-23-2023, 05:27 PM
Last Post: Larz60+
  Loop through json file and reset values [SOLVED] AlphaInc 2 2,335 Apr-06-2023, 11:15 AM
Last Post: AlphaInc
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,203 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 12,810 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan

Forum Jump:

User Panel Messages

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