Python Forum
count every 28 files and find desire files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
count every 28 files and find desire files
#1
hi
i need a code to get first file (after sorting files in folder) then count every 24 files index from that, pick them up then save them in another folder
in other word filter and select files with 24 times index from first file index in folder and delete others
Reply
#2
what have you tried?
Show your code, working or not.
Reply
#3
import os
path_of_the_directory = 'd:\m'
ext = ('.eof')
for files in os.listdir(path_of_the_directory):
    if files.endswith(ext):
          subindex = 0
          subindex = subindex + 24
          sorted(file_list)
        
    else:
.....
Larz60+ write Dec-12-2021, 08:45 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Reply
#4
Use the python button to insert your code (and not just with a small snippet.)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Open files in an existing window instead of new Kostov 2 252 Apr-13-2024, 07:22 AM
Last Post: Kostov
  Using zipfile module - finding folders not files darter1010 2 241 Apr-06-2024, 07:22 AM
Last Post: Pedroski55
  Is it possible to extract 1 or 2 bits of data from MS project files? cubangt 8 1,028 Feb-16-2024, 12:02 AM
Last Post: deanhystad
  File loop curiously skipping files - FIXED mbk34 10 779 Feb-10-2024, 07:08 AM
Last Post: buran
  Copy Paste excel files based on the first letters of the file name Viento 2 415 Feb-07-2024, 12:24 PM
Last Post: Viento
  Class test : good way to split methods into several files paul18fr 4 468 Jan-30-2024, 11:46 AM
Last Post: Pedroski55
  uploading files from a ubuntu local directory to Minio storage container dchilambo 0 445 Dec-22-2023, 07:17 AM
Last Post: dchilambo
  Upload Files to Azure Storage Container phillyfa 6 672 Dec-22-2023, 06:11 AM
Last Post: Pedroski55
  merge all xlsb files into csv mg24 0 328 Nov-13-2023, 08:25 AM
Last Post: mg24
  Newbie question about switching between files - Python/Pycharm Busby222 3 592 Oct-15-2023, 03:16 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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