I need to make input for a program that is really out of my programming skills, so I have not tried anything. I hope you help me.
I have many text files, starting with the ">" sign for the sample name, line break, and then the data at 0 and 1 for each sample.
The data looks like this (much larger):
>SampleName_ZN189A
01000001000000000000100011100000000111000000001000
00110000100000000000010000000000001100000010000000
00110000000000001110000010010011111000000100010000
00000110000001000000010100000000010000001000001110
>SampleName_ZN189B
00110000001101000001011100000000000000000000010001
00010000000000000010010000000000100100000001000000
00000000000000000000000010000000000010111010000000
01000110000000110000001010010000001111110101000000
Note. After every 50 characters, a line break occurs.
What do I need to do:
Extract the first 2000 characters of the data of each sample in my file and save it with the same name followed by the window number. For example, if this file was named: Testfile_1.txt, it should look like this (I extracted the first 50 characters of the data):
>SampleName_ZN189A
01000001000000000000100011100000000111000000001000
>SampleName_ZN189B
00110000001101000001011100000000000000000000010001
And this file should be named like this: Testfile_1_window1.txt
1500 3500, Testfile_1_window2.txt, 3000 5000 Testfile_1_window3.txt ..... 2000 .
, 2000 500 .
.
2:
, , perl python, .