Nate Brunelle Today: Web Reading

Slides:



Advertisements
Similar presentations
Unit 4 Buying fruit. an apple orange a peach apples.
Advertisements

Alternative FILE formats
Designing a Database Unleashing the Power of Relational Database Design.
Vendor Managed Inventory Malnove’s Standard Approach.
Files in Python Caution about readlines vs. read and split.
Add a File with X, Y coordinates to MapWindow
Separating Columns in Excel. An extremely useful function in Excel is the Text to Column feature which can be used for any type of column separation but.
VT SMS System User Manual
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
GOOGLE N-GRAMS ON AMAZON WEB SERVICES PART 2 Thomas Tiahrt, MA, PhD Computer Science 482 – Introduction to Text Analytics.
Prof. Alfred J Bird, Ph.D., NBCT Door Code for IT441 Students.
Python Mini-Course University of Oklahoma Department of Psychology Lesson 18 Using text files to share data with other programs 5/07/09 Python Mini-Course:
CS116 – Tutorial 11 Reading and Writing Files. Reminder Assignment 10 due July 28 th (Tuesday) 10:00am.
1 CHAPTER 3 StringTokenizer. 2 StringTokenizer CLASS There are BufferedReader methods to read a line (i.e. a record) and a character, but not just a single.
MySQL Importing and creating a database. CSV (Comma Separated Values) file CSV = Comma Separated Values – they are simple text files containing data which.
Files Tutor: You will need ….
Week 9 : Text processing (Reading and writing files)
# 1# 1 Moving SQL Data Across Applications How do you export and import data into or out of a database? What do we mean by.csv? CS 105 Spring 2010.
1 CSE 2337 Chapter 7 Organizing Data. 2 Overview Import unstructured data Concatenation Parse Create Excel Lists.
CSV Files Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Review: A Computational View Programming language common concepts: 1. sequence of instructions -> order of operations important 2. conditional structures.
网上报账系统包括以下业务: 日常报销 差旅费报销 借款业务 1. 填写报销内容 2. 选择支付方式 (或冲销借款) 3. 提交预约单 4. 打印预约单并同分类粘 贴好的发票一起送至财务 处 预约报销步骤: 网上报账系统 薪酬发放管理系统 财务查询系统 1.
Prof. Alfred J Bird, Ph.D., NBCT Office – McCormick 3rd floor 607.
ENGINEERING 1D04 Tutorial 2. What we’re doing today More on Strings String input Strings as lists String indexing Slice Concatenation and Repetition len()
File Processing Upsorn Praphamontripong CS 1110
Topic: File Input/Output (I/O)
Adirondack Solutions Users Group 2017
Creates the file on disk and opens it for writing
Comma Separated Values
The UK Tier 1 Entrepreneur Visa and the UK Representative of Overseas Business Visa - SmartMove2UK
How much does this cost to make?
TRAINING OF FOCAL POINTS ON THE CountrySTAT/FENIX SYSTEM
Using Delimited Files Alan Hunt – March 1st, 2017.
Seek Method and CSV Files
CSV File Manipulation.
I Like… Yes, I do. No, I don’t.
User Manual KC SMS System User Manual
Nate Brunelle Today: PyCharm
Nate Brunelle Today: Repetition, A Trip To The Moon
Creates the file on disk and opens it for writing
Seek Method and CSV Files
Fundamentals of Data Structures
Microsoft Excel 2007 The L Line The Express Line to Learning L Line
Nate Brunelle Today: Functions again, Scope
CS 1111 Introduction to Programming Fall 2018
Grid Files (Another example)
Nate Brunelle Today: Turtles
How to save information in files open, write, close
Nate Brunelle Today: Values and Types
Files Handling In today’s lesson we will look at:
CSV files Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An Introduction.
Nate Brunelle Today: Lists
Nate Brunelle Today: Lists
Nate Brunelle Today: Dictionaries
Nate Brunelle Today: Functions
Nate Brunelle Today: Strings, Type Casting
Nate Brunelle Today: Values and Types
Topics Introduction to File Input and Output
Colours and Fruit.
Nate Brunelle Today: Conditional Decision Statements
CSV Files and ETL The Good, Bad, and Ugly
Bananas apples peaches pears.
Nate Brunelle Today: Functions
Nate Brunelle Today: Strings, Type Casting
Nate Brunelle Today: Functions again, Scope
CS 1111 Introduction to Programming Spring 2019
CS 1111 Introduction to Programming Spring 2019
Files A common programming task is to read or write information from/to a file.
How to read from a file read, readline, reader
Introduction to Computer Science
Presentation transcript:

Nate Brunelle Today: Web Reading CS1110 Nate Brunelle Today: Web Reading

Questions?

Representing Data as Text CSV format: Comma Separated Values Data has records: One record per line Records separated by \n (newline) E.g. one purchase (Pears,2.8) Records have cells: Separated by , Each record must have the same number of cells E.g. the thing purchased (Pears) Apples,10.0 Pears,2.8 Peaches,5.2 Grapes,19.4 Apples,100.0

Processing a CSV Split text into lines (i.e. records) Split each line (record) into cells Do what we wanted to do with the cells

read() vs. readline() readline(): read(): readlines(): Gives the next line of text from the file read(): Gives the rest of the file as a string readlines(): Gives the rest of the file as a list of strings

Reading a file vs. web import urllib.request s = open(filename, ‘r’) for x in s: c = x.strip().split(‘,’) … import urllib.request s = urllib.request.urlopen(url) for x in s: x = x.decode(‘utf-8’) c = x.strip().split(‘,’) …