File Handling

 

  • How to read and write in csv files?
  •  

     

    Object of Read function

     

     

     

     

    List comprehension to read data in a text file

     

    Instead of load all the lines of text file at once, there is a process to load line by line called LIST COMPREHENSION. STRIP removes while spaces at begining and end of the line.

     

     

     

    Writing in a text file

     

  • 'W' denotes write in a text file
  • Before write the data it erases existing data
  •  

     

     

    Write the data from one text file to another

     

     

     

    Line doesn't starts with

     

     

    Read the data based on Line Number

     

     

    Data from text file to list and each row into a single tuple

     

     

    Data from text file to list and each row into a single List

     

     

    Print required Number of characters

     

     

    Retrieve words based on length

     

     

    Line doesn't stars with - Slicing with split

     

     

    Split the Line - Slicing the post split

     

     

    Find function to find a particular function

     

     

    Read Lines - and result display in single Line

     

     

    Find the Total Number of Lines

     

     

    Data Extraction - rows selection using combobox

     

  • Data extraction from text file and select the rows using combobox
  •