Data Storage Choices File or Database ? Binary or Text file ? Variable or fixed record length ? Choice of text file record and field delimiters XML anyone.

Slides:



Advertisements
Similar presentations
Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: The Basics.
Advertisements

CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
Learning Web development. 3(+1) Tier architecture PHP script Remote services Web Server (Apache, IIS) Browser (IE, FireFox, Opera) Desktop (PC or MAC)
Chapter Day 5. © 2007 Pearson Addison-Wesley. All rights reserved2-2 Agenda Day 5 Questions from last Class?? Problem set 1 Posted  Introduction on developing.
Variable Length Data and Records Eswara Satya Pavan Rajesh Pinapala CS 257 ID: 221.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
©2004 Brooks/Cole Chapter 1: Getting Started Sections Covered: 1.1Introduction to Programming 1.2Constructing a Java Program 1.3The print() and println()
Introduction to Python
Python and Web Programming
Guide To UNIX Using Linux Third Edition
Tutorial 8 Sharing, Integrating and Analyzing Data
C programming Language and Data Structure For DIT Students.
XIS™ XML Intranet System. XIS, the XML Intranet System provides the foundation for your database production and management. XIS maximizes the flexible.
Chapter 18 I/O in C. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Standard C Library I/O commands.
PHP Workshop ‹#› PHP: The Basics. PHP Workshop ‹#› What is it? PHP is a scripting language commonly used on web servers. –Stands for “PHP: Hypertext Preprocessor”
Ping Zhang 10/08/2010.  You can get data from the user (input) and display information to the user (output).  However, you must include the library.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
1. Fundamentals of Computer Systems Define a computer system Computer Systems in the modern world Professional standards for computer systems Ethical,
ASP.NET Programming with C# and SQL Server First Edition
CMPE13 Cyrus Bazeghi Chapter 18 I/O in C. CMPE Standard C Library I/O commands are not included as part of the C language. Instead, they are part.
A Variable is symbolic name that can be given different values. Variables are stored in particular places in the computer ‘s memory. When a variable is.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne.
Inside Module 7 Exporting Data to the World Page n Exporting data to other applications2 n STExport converts the data4 n Running STExport5 n Dates and.
CIT 383: Administrative Scripting
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
Input, Output, and Processing
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Agenda Regular Expressions (Appendix A in Text) –Definition / Purpose –Commands that Use Regular Expressions –Using Regular Expressions –Using the Replacement.
Chapter 18 I/O in C.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
With Python.  One of the most useful abilities of programming is the ability to manipulate files.  Python’s operations for file management are relatively.
GREP. Whats Grep? Grep is a popular unix program that supports a special programming language for doing regular expressions The grammar in use for software.
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
CSC141 Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture - 6.
WDDX Case Study: Building a Cross CFUG Search April Fleming.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Files Tutor: You will need ….
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Operating System Discussion Section. The Basics of C Reference: Lecture note 2 and 3 notes.html.
Program Development Cycle 1.Edit program 2.Compile program - translates it from C to machine language 3. Run/execute your program. 4. If not satisfied,
Shell scripts – part 1 Cs 302. Shell scripts  What is Shell Script? “Shell Script is series of command written in plain text file. “  Why to Write Shell.
Edexcel OnCourse Databases Unit 9. Edexcel OnCourse Database Structure Presentation Unit 9Slide 2 What is a Database? Databases are everywhere! Student.
Normalizing Data for Migration Kyle Banerjee
Formatted I/O ä ä Standard Output ä ä printf() family of functions ä ä Standard Input ä ä scanf() family of functions.
SIMPLE FILTERS. CONTENTS Filters – definition To format text – pr Pick lines from the beginning – head Pick lines from the end – tail Extract characters.
Topics Designing a Program Input, Processing, and Output
SE goes software engineering; (practically) managing the Compose
Type Checking Generalizes the concept of operands and operators to include subprograms and assignments Type checking is the activity of ensuring that the.
Chapter 18 I/O in C.
What is FITS? FITS = Flexible Image Transport System
Introduction to Scripting
Getting Started with C.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Introduction to C++ Programming
A poorly named Curt Hill utility program
Fundamentals of Data Structures
“If you can’t write it down in English, you can’t code it.”
File Input and Output.
Introduction to C++ Programming
Variable Length Data and Records
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
CSV Files and ETL The Good, Bad, and Ugly
Primitive Types and Expressions
Introduction to Programming - 1
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Data Storage Choices File or Database ? Binary or Text file ? Variable or fixed record length ? Choice of text file record and field delimiters XML anyone ?

File or Database ? Files are simple and straightforward for standalone, single user, non-concurrent applications. Concurrent applications with multiple simultaneous users can use lockfiles to protect file access. Databases are more reliable for production use in a networked multi-user context.

Binary or Text file ? With binary files data can be stored using internal format. Advantage: don't have to convert data on input or output. Disadvantage: binary files are less portable across networks, even across compiler settings. Alignment of structure members on word or byte boundaries ?

Variable or fixed record length ? Technically this choice is unrelated to whether a file is in text or binary format. In practice fixed length records are more likely for binary files. The advantages of fixed length records include: * Ability to randomly access records based on position within file. * Avoidance of space wasted for field and record delimiters. * Problem in choosing delimiters compatible with data or escaping data avoided.

Variable or fixed record length ? Advantages of variable length records include: * Except for delimiters, only space needed for data is used and less storage wasted. * Design of system does not directly constrain quantity of data.

Choice of text file record delimiter Normally characters which don't appear in data are used for record (end of line) and field delimiters. Newline is most commonly used as the record delimiter. Problem: what happens if newline is required within a data field ? Possible solution: escape this value e.g. using \n. Then you have to escape backslash and convert data on input and output. Other characters possible, but fgets() function assumes use of newline.

Choice of text file field delimiters This is more likely to involve a conflict between the data and delimiter. Normally different from the record delimiter, unless fields are counted or labelled. Popular delimiter characters include space, tab, comma ',', colon ':'. Many applications allow export/import using comma delimited format, typically double quoting strings e.g: Record No.,Name,Mark 123,"Asif Mohammed", ,"Joe Brown",72.1

Choice of text file field delimiters The appearance of a double quote within a string complicates this approach further. The fscanf function assumes space, tab or newline delimited data, but is insecure if data of the wrong type or length is encountered, and can behave unpredictably with strings containing embedded spaces. Some data can be simplified by converting embedded spaces into underscores, e.g. for file and variable names.

XML anyone ? XML (eXtended Markup Language) involves enclosing data within opening and closing tags. XML solves many internationalisation problems. Probably not useful for simple standalone applications. Can be useful for communicating data with a common and defined purpose between different platforms. Not a good match to most 'C' type applications. Better suited for Java, Perl, Python business and web enabled applications for which XML libraries are available.