Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Vikram Chiluka
Page 17 of 22
How to Print Lines Containing Given String in File using Python?
In this article, we will show you how to print all the lines that contain a given specific string in a text file using Python. This is a common task when searching through files for specific content or filtering data. Let's assume we have a text file named ExampleTextFile.txt with the following content ? Sample File Content Good morning to TutorialsPoint This is TutorialsPoint sample File Consisting of Specific source codes in Python, Seaborn, Scala Summary and Explanation Welcome to TutorialsPoint Learn with a joy Good morning to TutorialsPoint Algorithm (Steps) Following are ...
Read MoreHow to Find the Most Repeated Word in a Text File using Python?
In this article, we will show you how to find the most repeated word in a given text file using Python. We'll use the Counter class from the collections module to efficiently count word frequencies. Assume we have a text file named sample.txt containing some random text ? Good Morning TutorialsPoint This is TutorialsPoint sample File Consisting of Specific source codes in Python, Seaborn, Scala Summary and Explanation Welcome TutorialsPoint Learn with a joy Using Counter from Collections Module The Counter class is a specialized dictionary that counts hashable objects. It's perfect for counting ...
Read MoreHow to Find the Longest Words in a Text File using Python?
In this article, we will show you how to find and print all the longest words from a given text file using Python. The longest words are those having the same length as the maximum length word in the file. We'll demonstrate this with a sample text file containing various words of different lengths. Sample Text File Let's create a sample text file to work with ? # Create a sample text file sample_text = """Good Morning Tutorials Point This is Tutorials Point sample File Consisting of Specific abbreviated source codes in Python Seaborn Scala ...
Read MoreHow to Split given list and insert in excel file using Python?
In this article, we will show you how to split a Python list and insert those items into an Excel file using pandas. This technique is useful for organizing data into structured columns for analysis and reporting. Assume we have a list containing player names and countries. We'll split this list and create an Excel file with separate columns for each data type. Expected Output Our program will create an Excel file outputExcelFile.xlsx with the following structure ? Player Name Country Virat Kohli India Bhuvaneshwar Kumar India Mahendra ...
Read MoreHow to get values of all rows in a particular column in openpyxl in Python?
In this article, we will show you how to get all the row values of a particular column in an excel file using the openpyxl library in Python. This is useful when you need to extract specific column data from Excel files for analysis or processing. Assume we have an Excel file named sampleTutorialsPoint.xlsx containing cricket player data. We will extract all row values from a specific column. Sample Data: sampleTutorialsPoint.xlsx Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6300 20 Bhuvaneshwar ...
Read MoreHow to get sheet names using openpyxl in Python?
In this article, we will show you how to get all the sheet names found in an excel file using Python's openpyxl library. Assume we have taken an excel file with the name sampleTutorialsPoint.xlsx containing multiple sheets with some random data. We will return all the sheet names found in a given excel file using the sheetnames attribute. Sample Excel File Structure Our example file sampleTutorialsPoint.xlsx contains three sheets: firstSheet Player Name Age ...
Read MoreHow to find the number of Blank and Non-Blank cells in the Excel table using Python?
Excel files often contain blank cells, and counting these cells is a common requirement for data validation and analysis. Python's xlrd module provides an efficient way to read Excel files and count blank and non-blank cells. Assume we have an Excel file named sampleTutorialsPoint.xlsx containing cricket player data with some blank cells. We will count both empty and filled cells in the worksheet. Sample Data Here's our sample Excel file structure ? Player Name Age Type Country Team Runs Wickets Virat Kohli Batsman India Royal Challengers Bangalore 20 ...
Read MoreHow to find the frequency of a particular word in a cell of an excel table using Python?
Finding the frequency of a specific word in Excel cells is useful for data analysis and text processing. Python's pandas library provides an efficient way to read Excel files and count word occurrences. We'll demonstrate using a sample Excel file sampleTutorialsPoint.xlsx containing cricket player data. Sample Excel Data Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6500 20 Mahendra Singh Dhoni 39 Batsman India Chennai Super Kings 4600 0 Rashid Khan 24 Bowler Afghanistan Gujarat Titans 500 130 Hardik ...
Read MoreHow to find the first empty row of an excel file in Python?
In this article, we will show you how to find the index of the first empty row in an Excel file using Python. This is useful for data processing tasks where you need to identify gaps in your data or find where to insert new records. We'll work with a sample Excel file called sampleTutorialsPoint.xlsx containing cricket player data with some empty rows ? Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6300 20 Bhuvaneshwar Kumar 34 Batsman India Sun Risers Hyderabad 333 140 ...
Read MoreHow to Copy Odd Lines of Text File to Another File using Python
In this article, we will show you how to copy only odd lines of a text file to another text file using Python. This is useful when you need to extract every alternate line starting from the second line. Assume we have a text file named TextFile.txt with some sample content. We need to copy all the odd-numbered lines (2nd, 4th, 6th, etc.) to another file. Sample Input File TextFile.txt Good Morning This is the Tutorials Point sample File Consisting of Specific source codes in Python, Seaborn, Scala Summary and Explanation Welcome everyone Learn with ...
Read More