About 11,900,000 results
Open links in new tab
  1. How to skip to a line via character seeking in Python

    Oct 19, 2016 · Try using the readlines function. This will return a list containing each line. You can use a for loop to parse through each line, searching for what you need, then obtain the …

  2. python - How to jump to a particular line in a huge text file?

    Calculate byte offset of corresponding line number in index file(possible because line size of index file is constant). Use seek or whatever to directly jump to get the line from index file. Parse to …

  3. Skip first couple of lines while reading lines in Python file

    Mar 6, 2012 · There's no way to magically jump to a line number. ~250 MB should be OK to read entire file to memory though, that's not particularly big data. Use itertools.islice, starting at …

  4. Python seek() function - GeeksforGeeks

    Apr 28, 2022 · In Python, seek() function is used to change the position of the File Handle to a given specific position. File handle is like a cursor, which defines from where the data has to …

    Missing:

    • Lines

    Must include:

  5. Skipping Initial Lines When Reading a Python File in Python 3

    Aug 12, 2024 · One way to skip initial lines when reading a Python file is by using the readline() method. This method reads a single line from the file and moves the file pointer to the next …

  6. Jump to a Specific Line in Python – Quick and Easy Guide

    Using the seek() method to jump to a specific line. Python’s seek() method allows you to navigate to a specific position in a file. By using this method, we can efficiently jump to a desired line in …

  7. How Can You Skip Lines in Python: A Step-by-Step Guide?

    Python provides several methods to selectively skip lines, allowing you to focus on the data that matters most. From reading files line by line to using built-in functions that facilitate this …

    Missing:

    • Seek

    Must include:

  8. 3 Ways to Read a File and Skip Initial Comments in Python

    Jan 31, 2018 · Here are 3 ways to read a text file line by line Python and skip initial comment lines. You don’t have to know how many lines you want to skip. The first approach is a naive …

  9. python - How to seek to a specific line in a file? - Stack Overflow

    Nov 12, 2016 · The best way is to use seek, like in this example: fp = open('myfile') last_pos = fp.tell() line = fp.readline() while line != '': if line == 'SPECIAL': fp.seek(last_pos) …

  10. How to Skip a Line in Python? [4 Ways] - Python Guides

    Feb 5, 2024 · One of the simplest ways to skip a line in Python is by using the pass statement, which acts as a placeholder. It allows you to bypass a code line without causing any Python …

    Missing:

    • Seek

    Must include:

  11. Some results have been removed
Refresh