TestingDocs.com
    Software Testing website
    • Automation
      • Selenium
      • JBehave Framework
    • Tutorials
      • MySQL Tutorials
      • Testlink
      • Maven
      • Git
    • IDEs
      • IntelliJ IDEA
      • Eclipse
    • Flowcharts
      • Flowgorithm
      • Raptor
    • About

    Flowgorithm

    Search Text File Flowchart Example

    Overview

    In this tutorial, we will search a text file using Flowgorithm. This flowchart example will show the usage of the new File I/O flowchart symbols in action.

    File I/O Symbols are:

    https://www.testingdocs.com/flowgorithm-file-symbols/

    The flowchart will prompt the user to enter a student name. It will search for the name in the file and let the user know if the student’s name is present in the input file.

    Create a text file

    The input text file to the flowchart contains the names of students. Create a text file called names.txt. Let’s assume that each student’s name is in a single line.

    Sample file:

     

    File Search Input File Flowgorithm

    Design the flowchart

    Let’s design the flowchart to search the text file.

    Open the File

    Open the input file in the Read mode using the Open file symbol.

    Open input File Read Mode

    Declare the variables.

    String variables line and searchName. The line contains the student’s name in each line

    Boolean variable isFound initially set to False. We will set this flag to True when there is a match.

    Declare Variables File Search

    Prompt the user to enter the search name. The user will enter that name to be searched in the file.

     

    Add Loop and Read File

    Add a loop and in the loop read the line using the Read file symbol. We will match it with the search name. If they both matches set the found flag to True and display that the name is in the file.

    File Read File Search Command

    Close the File

    If not isFound then print the message that the name is not found. Close the file handle using the Close file symbol.

    Close the File Search

    Sample Output

    Save and Run the flowchart with a test case. Search for a student name to view the output.

    File Search Output Flowgorithm

    —

    Flowgorithm Tutorials

    Flowgorithm flowchart tutorials on this website:

    https://www.testingdocs.com/flowgorithm-flowchart-tutorial/

    Flowgorithm Website

    For more information on the Flowgorithm tool, please visit the official website at:

    http://flowgorithm.org/

    Related Posts

    Print Triangle Pattern Flowchart

    Flowgorithm /

    Print Triangle Pattern Flowchart

    Flowgorithm Breakpoint Symbol

    Flowgorithm /

    Flowgorithm Conditional Breakpoint Statement

    File Read Declare Variables

    Flowgorithm /

    Flowgorithm Read Numbers from File Example

    Flowgorithm Turtle Graphics Symbols

    Flowgorithm /

    Flowgorithm Turtle Graphics Symbols

    Draw Circle Flowgorithm Flowchart

    Flowgorithm /

    Draw Circle using Flowgorithm Turtle

    ‹ Flowgorithm Turtle Graphics Symbols› Flowgorithm Read Numbers from File Example

    Recent Posts

    • Stellar Converter for Database
    • Stellar Log Analyzer for MySQL
    • Stellar Repair for MySQL
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI Features
    • Shaping the Future of Development: Exploring Key Trends in Software Engineering
    • Improving Java Performance with Multithreading
    • Open-source Vector Databases
    • Difference between PHP and JavaScript?
    • Bing Conversation Styles

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com