Python Forum
while x < x and z not c
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
while x < x and z not c
#1
Hi all,

i am in need of some guide ;-)

The situation is :

I have some files that contain Datasets of 5 records. now i want to re arrange the Files to contain e.g. 200 records.

There is no need to extract data from the original Files, they can be joined all together.
The files are stored like "s 1 m 3940.txt" , "s 1 m 3945.txt" and following up to "s 1 m 4925.txt"

Given that i already have some code that returns the Values i need for processing like

x = first file to be created for the new arrangement , which is 3800 for "s 1 n 3800.txt" in that case
c = number of dummy data that needs to be padded infront before merging "s 1 m 3940.txt" , 140 for this case
y = last record package that can be loaded (4925 for "s 1 m 4925.txt")
i = categpry of record data (static and not in or decreasing)

I start with opening the new file with
	with io.open("s "+str(i+1)+" n "+str(x)+".seq", 'wb') as msg:  # open first new message file
				for item in fillarray:
					msg.write(item)
				
				
			msg.close
After that i would start joining the other files until i reach "s 1 m 4000.txt" which is the easiest thing.

But what i dont understand is how to build the loop that does joining the following packages and create a new file as soon as 200 records have been reached?
Reply


Forum Jump:

User Panel Messages

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