Parsing: Splitting fields into atomic attributes.

Slides:



Advertisements
Similar presentations
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Strings.
Advertisements

Printf transformation in TXL Mariano Ceccato ITC-Irst Istituto per la ricerca Scientifica e Tecnologica
Object-Oriented Design Excerpted from Number 2130: “Imaginary Christmases”, from Used with permission of the artist,
Java Strings in 10 minutes
 Just the word will find too many instances  Searching for blanks on both sides loses start and end  How to solve? › See last Thursday examples.
An Introduction to Programming with C++ Fifth Edition Chapter 12 String Manipulation.
Strings In Java, strings are contained in an object that is an instance of the String class. String in java is the name of a class. That’s why it starts.
Tutorial 14 Working with Forms and Regular Expressions.
8. Characters and Strings HTML version. Properties Length of every character variable must be specified in advance: CHARACTER STR*10 CHARACTER STRA(20)*10.
Data Transformation Data cleaning. Importing Data Reading data from external formats Libname/Infile/Input for text form data Proc Import for Excel/Access.
1.10 Strings academy.zariba.com 1. Lecture Content 1.What is a string? 2.Creating and Using strings 3.Manipulating Strings 4.Other String Operations 5.Building.
1.
XP Tutorial 14 New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
Tutorial 14 Working with Forms and Regular Expressions.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 9 More About Strings.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 8: The string Type.
Logic (continuation) Boolean Logic and Bit Operations.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 24 The String Section.
Chapter 12: String Manipulation Introduction to Programming with C++ Fourth Edition.
Functions and Arrays. Predefined Functions eval(condition) –Evaluates (executes) JavaScript syntax –Eval returns an undefined value parseInt(string) and.
Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
Python for NLP Regular Expressions CS1573: AI Application Development, Spring 2003 (modified from Steven Bird’s notes)
Project 1: Using Arrays and Manipulating Strings Essentials for Design JavaScript Level Two Michael Brooks.
More Strings CS303E: Elements of Computers and Programming.
 How do you represent a number with no value?  Mathematicians defined the “number” 0 (zero)  How do we represent a string with no value?  Use an empty.
Unit 11 –Reglar Expressions Instructor: Brent Presley.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming strings.
Working with Strings. String Structure A string in VBA can be variable length and has an internal structure Each character in the string has a position.
Processing Text Excel can not only be used to process numbers, but also text. This often involves taking apart (parsing) or putting together text values.
Strings Can view as array of chartacters –Implemented as a class with its own methods Simplest operation on strings is catenating two strings String x.
Strings Methods in the String class Manipulating text in Java.
More about strings in C++. String member functions The next three slides present information about functions that are members of the C++ string class.
XP Tutorial 7 New Perspectives on JavaScript, Comprehensive 1 Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
8 1 String Manipulation CGI/Perl Programming By Diane Zak.
Chapter 23 The String Section (String Manipulation) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Strings in Python String Methods. String methods You do not have to include the string library to use these! Since strings are objects, you use the dot.
The Methods and What You Need to Know for the AP Exam
Strings A String is a sequence of letters
Theory of Computation Lecture #
Computer Programming ||
MARK CARPENTER, Ph.D. Introduction to SAS Programming and Applications
Working with Forms and Regular Expressions
CSC141 Computer Science I Zhen Jiang Dept. of Computer Science
Array List Pepper.
Advanced Programming Behnam Hatami Fall 2017.
SAS in Data Cleaning.
Perl Variables: Array Web Programming.
A more complex example.
Chapter 8: The string Type
Topics discussed in this section:
CS 106 Computing Fundamentals II Chapter 66 “Working With Strings”
Functions, Regular expressions and Events
16 Strings.
Microsoft Visual Basic 2005: Reloaded Second Edition
CS1110 Today: collections.
Topic 6 Lesson 1 – Text Processing
String.
ReportSmith & ADP PC/Payroll For Windows
Topics Basic String Operations String Slicing
JavaScript: Objects.
String Processing 1 MIS 3406 Department of MIS Fox School of Business
Lecture 5 SQL FUNCTIONS.
Topics Basic String Operations String Slicing
Context Free Grammars-II
Index Structures Consider a relation Employees (eid, name, salary, age, did) stored as a heap file (unsorted) for which the only index is an unclustered.
Topics Basic String Operations String Slicing
P8.py.
Evaluating an expression with two variable
Unit-2 Objects and Classes
What We Want To Do User enters: Mary Smith
Presentation transcript:

Parsing: Splitting fields into atomic attributes. Data Transformation Parsing: Splitting fields into atomic attributes.

=SUBSTR( string, position<, length>) Use this when you have a known position for characters. String: character expression Position: start position (starts with 1) Length: number of characters to take (missing takes all to the end) VAR= ‘ABCDEFG’ NEWVAR= SUBSTR(VAR,2,2) NEWVAR2= SUBSTR(VAR,4) NEWVAR= ‘BC’ NEWVAR2= ‘DEFG’

SUBSTR(variable, position<,length>) = new-characters Replaces character value contents. Use this when you know where the replacement starts. a='KIDNAP'; substr(a,1,3)='CAT'; a: CATNAP substr(a,4)='TY' ; a: KIDTY

INDEX(source, excerpt) Searches a character expression for a string of characters. Returns the location (number) where the string begins. a='ABC.DEF (X=Y)'; b='X=Y'; x=index(a,b); x: 10 x= index(a,’DEF’); x: 5

Alternative INDEX functions INDEXC searches for a single character INDEXW searches for a word: Syntax INDEXW(source, excerpt<,delimiter>)

Length Returns the length of a character variable The LENGTH and LENGTHN functions return the same value for non-blank character strings. LENGTH returns a value of 1 for blank character strings, whereas LENGTHN returns a value of 0. The LENGTH function returns the length of a character string, excluding trailing blanks, whereas the LENGTHC function returns the length of a character string, including trailing blanks. LENGTH always returns a value that is less than or equal to the value returned by LENGTHC.