Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Subdividing a column
#1
Hi,

I have an "input.txt" file which contains this column of numbers:

5 
77 
1
-4
9
17
13
2
1
5
63
8
I would like that column to be divided into columns side by side, whose the number of elements is established by this vector:
(4,2,5,1)
Output should look like this:

Output:
5 9 13 8 77 17 2 1 1 -4 5 63
The output should be saved in an "output.txt" file.

Any tips?

Thank you,

m.
Reply


Messages In This Thread
Subdividing a column - by mesh01 - Jun-27-2021, 04:18 PM
RE: Subdividing a column - by Larz60+ - Jun-28-2021, 02:25 AM
RE: Subdividing a column - by mesh01 - Jun-28-2021, 10:00 PM
RE: Subdividing a column - by bowlofred - Jun-28-2021, 11:05 PM
RE: Subdividing a column - by mesh01 - Jun-29-2021, 01:35 PM
RE: Subdividing a column - by mesh01 - Jul-02-2021, 01:06 PM
RE: Subdividing a column - by deanhystad - Jul-02-2021, 04:52 PM
RE: Subdividing a column - by bowlofred - Jul-02-2021, 09:20 PM
RE: Subdividing a column - by perfringo - Jul-04-2021, 06:59 PM

Forum Jump:

User Panel Messages

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