SlideShare una empresa de Scribd logo
1 de 5
Descargar para leer sin conexión
READING IN FILES
     REUSEABLE!
Sometimes programs need access to
         other files . . .

                        Hey! That file
                         has stuff I
                           need!




    FILE                PROGRAM
Using VB to read the contents of a
                 text file
 The variable fileReader now has the contents of the file called
                           config.txt

Dim fileReader As String

fileReader = My.Computer.FileSystem.ReadAllText("Y:config.txt")
Presenting the contents of a text file



Dim fileReader As String

fileReader = My.Computer.FileSystem.ReadAllText("Y:config.txt")

MsgBox(fileReader)
Why could we want to read files in!
• We can use text files to store data that we
  want to return to.
• You may not have noticed but when you close
  your program, all the data it was using goes.

Más contenido relacionado

La actualidad más candente

La actualidad más candente (10)

HDFS
HDFSHDFS
HDFS
 
File handling
File handlingFile handling
File handling
 
Pattern matching & file input and output
Pattern matching & file input and outputPattern matching & file input and output
Pattern matching & file input and output
 
NOSQL Databases
NOSQL DatabasesNOSQL Databases
NOSQL Databases
 
Postgis setup
Postgis setupPostgis setup
Postgis setup
 
File handling
File handlingFile handling
File handling
 
File handling
File handlingFile handling
File handling
 
2.5 lab1
2.5 lab12.5 lab1
2.5 lab1
 
Database storage engine
Database storage engineDatabase storage engine
Database storage engine
 
Whats A Hash
Whats A HashWhats A Hash
Whats A Hash
 

Destacado

โรคคอเลสเตอรอล
โรคคอเลสเตอรอลโรคคอเลสเตอรอล
โรคคอเลสเตอรอลK'igasune Mirinchan
 
Sf Group Presentation
Sf Group PresentationSf Group Presentation
Sf Group Presentationlchetwynd
 
Usuarios del Sistema Operativo
Usuarios del Sistema OperativoUsuarios del Sistema Operativo
Usuarios del Sistema OperativoCristianCf07
 
Melakukan perbaikan peripheral
Melakukan perbaikan peripheralMelakukan perbaikan peripheral
Melakukan perbaikan peripheralregianza
 
особливості реалізації основних положень концепції розвитку психологічної слу...
особливості реалізації основних положень концепції розвитку психологічної слу...особливості реалізації основних положень концепції розвитку психологічної слу...
особливості реалізації основних положень концепції розвитку психологічної слу...punkoff34
 
Психологічна допомога дітям у кризовому стані
Психологічна допомога дітям у кризовому станіПсихологічна допомога дітям у кризовому стані
Психологічна допомога дітям у кризовому станіpunkoff34
 
Master SmmUS 2015/2016 - Gestión de comunidades y crisis online
Master SmmUS 2015/2016 - Gestión de comunidades y crisis onlineMaster SmmUS 2015/2016 - Gestión de comunidades y crisis online
Master SmmUS 2015/2016 - Gestión de comunidades y crisis onlineXavi Marcé Vila
 
Melakukan perbaikan peripheral
Melakukan perbaikan peripheralMelakukan perbaikan peripheral
Melakukan perbaikan peripheralregianza
 
комп`ютерна залежність
комп`ютерна залежністькомп`ютерна залежність
комп`ютерна залежністьpunkoff34
 

Destacado (19)

Presentation2
Presentation2Presentation2
Presentation2
 
Presentaci n1 (1)
Presentaci n1 (1)Presentaci n1 (1)
Presentaci n1 (1)
 
Rounding numbers
Rounding numbersRounding numbers
Rounding numbers
 
AIS clubs
AIS clubsAIS clubs
AIS clubs
 
โรคคอเลสเตอรอล
โรคคอเลสเตอรอลโรคคอเลสเตอรอล
โรคคอเลสเตอรอล
 
Sf Group Presentation
Sf Group PresentationSf Group Presentation
Sf Group Presentation
 
Select case
Select caseSelect case
Select case
 
If
IfIf
If
 
Usuarios del Sistema Operativo
Usuarios del Sistema OperativoUsuarios del Sistema Operativo
Usuarios del Sistema Operativo
 
Melakukan perbaikan peripheral
Melakukan perbaikan peripheralMelakukan perbaikan peripheral
Melakukan perbaikan peripheral
 
особливості реалізації основних положень концепції розвитку психологічної слу...
особливості реалізації основних положень концепції розвитку психологічної слу...особливості реалізації основних положень концепції розвитку психологічної слу...
особливості реалізації основних положень концепції розвитку психологічної слу...
 
Savonuk
SavonukSavonuk
Savonuk
 
Психологічна допомога дітям у кризовому стані
Психологічна допомога дітям у кризовому станіПсихологічна допомога дітям у кризовому стані
Психологічна допомога дітям у кризовому стані
 
Master SmmUS 2015/2016 - Gestión de comunidades y crisis online
Master SmmUS 2015/2016 - Gestión de comunidades y crisis onlineMaster SmmUS 2015/2016 - Gestión de comunidades y crisis online
Master SmmUS 2015/2016 - Gestión de comunidades y crisis online
 
Arrays
ArraysArrays
Arrays
 
Syntax errors
Syntax errorsSyntax errors
Syntax errors
 
Melakukan perbaikan peripheral
Melakukan perbaikan peripheralMelakukan perbaikan peripheral
Melakukan perbaikan peripheral
 
комп`ютерна залежність
комп`ютерна залежністькомп`ютерна залежність
комп`ютерна залежність
 
Variables
VariablesVariables
Variables
 

Similar a Reading in files

FILE HANDLING in python to understand basic operations.
FILE HANDLING in python to understand basic operations.FILE HANDLING in python to understand basic operations.
FILE HANDLING in python to understand basic operations.ssuser00ad4e
 
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reugeFile handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reugevsol7206
 
File handling4.pdf
File handling4.pdfFile handling4.pdf
File handling4.pdfsulekha24
 
Data file handling in c++
Data file handling in c++Data file handling in c++
Data file handling in c++Vineeta Garg
 
Binary File.pptx
Binary File.pptxBinary File.pptx
Binary File.pptxMasterDarsh
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and outputallenbailey
 
File handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxFile handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxarmaansohail9356
 
File handling & regular expressions in python programming
File handling & regular expressions in python programmingFile handling & regular expressions in python programming
File handling & regular expressions in python programmingSrinivas Narasegouda
 
File handling and Dictionaries in python
File handling and Dictionaries in pythonFile handling and Dictionaries in python
File handling and Dictionaries in pythonnitamhaske
 

Similar a Reading in files (20)

FILE HANDLING in python to understand basic operations.
FILE HANDLING in python to understand basic operations.FILE HANDLING in python to understand basic operations.
FILE HANDLING in python to understand basic operations.
 
pspp-rsk.pptx
pspp-rsk.pptxpspp-rsk.pptx
pspp-rsk.pptx
 
File handling3.pdf
File handling3.pdfFile handling3.pdf
File handling3.pdf
 
Python file handling
Python file handlingPython file handling
Python file handling
 
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reugeFile handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
 
File handling4.pdf
File handling4.pdfFile handling4.pdf
File handling4.pdf
 
Data file handling in c++
Data file handling in c++Data file handling in c++
Data file handling in c++
 
Binary File.pptx
Binary File.pptxBinary File.pptx
Binary File.pptx
 
Chapter - 5.pptx
Chapter - 5.pptxChapter - 5.pptx
Chapter - 5.pptx
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and output
 
File handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxFile handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptx
 
File Handling
File HandlingFile Handling
File Handling
 
File Handling
File HandlingFile Handling
File Handling
 
FILE HANDLING.pptx
FILE HANDLING.pptxFILE HANDLING.pptx
FILE HANDLING.pptx
 
Java file
Java fileJava file
Java file
 
File handling & regular expressions in python programming
File handling & regular expressions in python programmingFile handling & regular expressions in python programming
File handling & regular expressions in python programming
 
Files in Python.pptx
Files in Python.pptxFiles in Python.pptx
Files in Python.pptx
 
Files in Python.pptx
Files in Python.pptxFiles in Python.pptx
Files in Python.pptx
 
Comp102 lec 11
Comp102   lec 11Comp102   lec 11
Comp102 lec 11
 
File handling and Dictionaries in python
File handling and Dictionaries in pythonFile handling and Dictionaries in python
File handling and Dictionaries in python
 

Más de Peter Andrews

Más de Peter Andrews (7)

Trimming text
Trimming textTrimming text
Trimming text
 
Splitting up text
Splitting up textSplitting up text
Splitting up text
 
Is numeric
Is numericIs numeric
Is numeric
 
Loops
LoopsLoops
Loops
 
Collecting user input
Collecting user inputCollecting user input
Collecting user input
 
Hello world
Hello worldHello world
Hello world
 
Flow charts
Flow chartsFlow charts
Flow charts
 

Último

How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17Celine George
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxDr. Santhosh Kumar. N
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice documentXsasf Sfdfasd
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptxmary850239
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...CaraSkikne1
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxraviapr7
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxKatherine Villaluna
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsEugene Lysak
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxMYDA ANGELICA SUAN
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRATanmoy Mishra
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxraviapr7
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational PhilosophyShuvankar Madhu
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxDr. Asif Anas
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfMohonDas
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationMJDuyan
 

Último (20)

How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
Prelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quizPrelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quiz
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptx
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice document
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptx
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptx
 
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdfPersonal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George Wells
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptx
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational Philosophy
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdf
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive Education
 

Reading in files

  • 1. READING IN FILES REUSEABLE!
  • 2. Sometimes programs need access to other files . . . Hey! That file has stuff I need! FILE PROGRAM
  • 3. Using VB to read the contents of a text file The variable fileReader now has the contents of the file called config.txt Dim fileReader As String fileReader = My.Computer.FileSystem.ReadAllText("Y:config.txt")
  • 4. Presenting the contents of a text file Dim fileReader As String fileReader = My.Computer.FileSystem.ReadAllText("Y:config.txt") MsgBox(fileReader)
  • 5. Why could we want to read files in! • We can use text files to store data that we want to return to. • You may not have noticed but when you close your program, all the data it was using goes.