• Home
  • Python
  • Pandas
  • Numpy
  • C++11
  • C++
  • STL
  • Multithreading
  • Courses
  • About Us
  • Privacy Policy
  • Write for us
Top Menu
  • Home
  • Python
  • Pandas
  • Numpy
  • C++11
  • C++
  • STL
  • Multithreading
  • Courses
  • About Us
  • Privacy Policy
  • Write for us

thispointer.com

  • Home
  • Python
  • Numpy
  • Pandas
  • C++11
  • C++
  • Courses
  • STL
  • Multithreading
  • Mysql
  • Linux
  • Boost Library
    • Boost Date Time Library
    • Boost String Algorithms Library
  • Design Patterns
  • java
  • Datastructure
    • Binary Search Tree
    • Binary Tree
    • Linked List
  • Subscribe
  • Write for us
You are here: Home » Python » FileHandling

Python: Read a file in reverse order line by line

Varun March 2, 2020 Python: Read a file in reverse order line by line2020-03-02T17:39:10+05:30 FileHandling No Comment
In this article we will discuss an efficient solution to read the contents of a text or CSV file in reverse order either line by line or get them as…
Continue Reading »

Python: Read CSV into a list of lists or tuples or dictionaries | Import csv to list

Varun February 2, 2020 Python: Read CSV into a list of lists or tuples or dictionaries | Import csv to list2020-02-02T23:30:22+05:30 csv No Comment
In this article we will discuss how to import a CSV into list. This list can be a list of lists, list of tuples or list of dictionaries. We will…
Continue Reading »

Python: How to insert lines at the top of a file?

Varun January 26, 2020 Python: How to insert lines at the top of a file?2020-01-26T22:43:52+05:30 FileHandling No Comment
In this article, we will discuss how to insert single or multiple lines at the beginning of a text or CSV file in python. (more…)
Continue Reading »

Python: Read a CSV file line by line with or without header

Varun January 25, 2020 Python: Read a CSV file line by line with or without header2020-01-25T23:25:17+05:30 csv No Comment
In this article we will discuss how to read a CSV file line by line with or without header. Also select specific columns while iterating over a CSV file line…
Continue Reading »

Python: Get last N lines of a text file, like tail command

Varun January 19, 2020 Python: Get last N lines of a text file, like tail command2020-01-19T22:35:13+05:30 FileHandling No Comment
In this article, we will discuss a memory-efficient solution to read the last line or last N lines from a text or CSV file in python. Then we will also…
Continue Reading »

Python: How to append a new row to an existing csv file?

Varun January 16, 2020 Python: How to append a new row to an existing csv file?2020-01-16T21:51:33+05:30 FileHandling No Comment
In this article, we will discuss how to append a row to an existing csv file using csv module's reader / writer & DictReader / DictWriter classes. (more…)
Continue Reading »

Python: Add a column to an existing CSV file

Varun January 12, 2020 Python: Add a column to an existing CSV file2020-01-12T19:15:35+05:30 FileHandling No Comment
In this article we will discuss how to add a column to an existing CSV file using and classes. A part from appending the columns we will also discuss how…
Continue Reading »

Python: How to delete specific lines in a file in a memory-efficient way?

Varun January 5, 2020 Python: How to delete specific lines in a file in a memory-efficient way?2020-01-05T22:31:54+05:30 FileHandling No Comment
In this article, we will discuss different ways to delete specific lines from a file either by line number, by matching content or based on any custom logic. (more…)
Continue Reading »

Python: Get file size in KB, MB or GB – human-readable format

Varun December 21, 2019 Python: Get file size in KB, MB or GB – human-readable format2019-12-21T23:17:05+05:30 FileHandling No Comment
In this article, we will discuss different ways to get file size in human-readable formats like Bytes, Kilobytes (KB), MegaBytes (MB), GigaBytes(GB) etc. (more…)
Continue Reading »

Python: Three ways to check if a file is empty

Varun December 16, 2019 Python: Three ways to check if a file is empty2019-12-16T09:08:03+05:30 FileHandling No Comment
In this article, we will discuss different ways to check if a file is empty its size is 0 using () or () or by reading its first character. (more…)
Continue Reading »
123

Recent Articles

  • MySQL IF EXISTS DROP Table
  • Every derived table must have its own alias
  • MySQL Delete Duplicate Rows but keep one
  • Find duplicate rows in MySQL
  • Linux: Find files modified in last N minutes

Search

Python tutorials

  • Strings
  • Lists
  • Tuple
  • Dictionary
  • Functions
  • File Handling
  • Lambda Functions

C++ / C++11 Tutorials

  • C++ Tutorials
  • C++11 Tutorial
  • C++ Interview Questions
  • Multithreading
  • C++17
  • STL Tutorials

Terms of Use

  • Terms of use
  • Write for us

Favorite Sites

  • ManagementBliss
  • dbPointer

Terms and Policies

  • Disclaimer
  • Cookie policy (EU)
  • Cookie policy (UK)
  • Privacy statement (EU)
  • Privacy statement (UK)
  • Privacy statement (US)
  • Do Not Sell My Personal Information
Copyright ©2021. thispointer.com
  • Home
  • Python
  • Pandas
  • Numpy
  • C++11
  • C++
  • STL
  • Multithreading
  • Courses
  • About Us
  • Privacy Policy
  • Write for us