473,800 Members | 2,614 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remove first line of 100 files in a folder using python script

1 New Member
Hi,

I am a bit new in python. Would be nice to get some help. I would like to remove the first line of 100 files in a folder. How can i proceed to write a python script. I can do it for a single file, but dont know how can I modify my script to run it for a folder containing 100 files with .txt extension.

Tatiana
Mar 17 '11 #1
2 2681
dwblas
626 Recognized Expert Contributor
I can do it for a single file
Place that code in a function and pass each file name to the function.
Mar 18 '11 #2
Bishop Manu
5 New Member
folder='\locati on of the folder'
for file in folder:
(do your stuff here)
Mar 18 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
14269
by: learnerofpython | last post by:
I have a cygwin application which i have invoked using python script like: os.system("path of the exe file") How can i enter text in the cygwin( which has appeared )using the python script itself???
1
3055
by: GnanaKumar | last post by:
hi, Can any one explain me how to execute COBOL program using Python scripts... do i need any third party tool to do this.. can you pls help me out regards, Gnana Kumar
1
22204
by: ashok0866 | last post by:
I had created a macro to read data from an excel sheet and write the values to a text file. I had used "ActiveSheet.Range("GB" & k).Value" command to read the values from the excel. The issue is: some cells in the excel sheet is having two lines value and four lines data, the text file is generating that value in a single line. (Ex. the cell value in address column is in four lines and should display in four lines in the text file...
1
25245
by: ShaheerAbdulrahiman | last post by:
Hi All, How can we get the file names in a folder using python? Could you please help me....? Thanks and Regards, Shaheer
1
2302
by: deardp | last post by:
hi : i need to convert an image (ex: jpeg or gif) into binary form and generating the image back to the original one using python script(it was some thing like decoding and encoding). pls pass me if u have any code. regards Durga
4
13756
by: itcecsa | last post by:
Hi, I am implementing a small Python project, what I am going to do is to open Matlab and run some M-files, and get some output from Matlab command prompt. I have no idea how to open Matlab from Python! Any suggestions would be appriciated!
2
6647
by: EdKing | last post by:
Hi everyone, I'm currently trying to get the simplest "Hello World!" Python script working on a Telit GM862-GPS. I have succeeded in writing to the Telit via the Hyper Terminal and can confirm that the program is enabled. However, I cannot get the Telit to relay "Hello World!" back to the Hyper Terminal, even after trawling through Telit's user guides. The code is: import MDM print 'Hello World!' result = MDM.send('AT\r', 0) print...
1
2414
by: dkhansoft | last post by:
Hi everybody, in my application there is one folder which is ziped and contains videos,text files, exe files and so on, i wnt to give download feature for end user, can anybody know how can i do this basically i wnt to give download option to end user
1
1903
by: TP | last post by:
Hi everybody, All my problem is in the title. If I try: $ python -c 'print "foo",' It does not change anything, surely because the line return is added by "python -c".
1
3740
by: meenu_susi | last post by:
hello could u please send me the code for creating a folder in ftp server using vb script I have tried with the following code <script language="vbscript"> Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.CreateFolder("ftp://ftp.xx.xx..com") </script>
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10279
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10255
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10036
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.