$ cat test.xml | ruby -e "puts ARGF.read.scan(/<article-title>(.*?)<\/article-title>/m).flatten.map { |title| title.gsub(/\s+/, ' ') }" | wc -l
78
$ cat test.xml | ruby -e "puts ARGF.read.scan(/<article-title>(.*?)<\/article-title>/m).flatten.map { |title| title.gsub(/\s+/, ' ') }"
Chemical Approaches To Perturb, Profile, and Perceive Glycans
On the frequency of protein glycosylation, as deduced from analysis of the SWISS-PROT database
Annotation of glycoproteins in the SWISS-PROT database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ca.uwo.csd.cs2212.USERNAME; | |
public class BankAccount { | |
private double balance; | |
public BankAccount(double balance) { | |
this.balance = balance; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*PPD-Adobe: "4.3" | |
*%****************************************************************************** | |
*% Adobe PostScript(R) Printer Description File | |
*% For Lexmark T644 | |
*% Produced by Lexmark International, Inc. | |
*% | |
*% Copyright (c) 2005 Lexmark International Inc. All Rights Reserved. | |
*% Permission is granted for redistribution of this file as | |
*% long as this copyright notice is intact and the content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'jquery-ace-rails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script can be run using any of the following: | |
# | |
# ruby XmlParsingExampleExplained < file1.xml | |
# cat file1.xml | ruby XmlParsingExampleExplained | |
# ruby XmlParsingExampleExplained file1.xml | |
# | |
# Note that multiple XML files should NOT be specified at the same time, as was possible in the regex matching example. | |
# Require the Nokogiri library -- this library must be installed with 'gem install nokogiri' | |
require 'nokogiri' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script can be run using any of the following: | |
# | |
# ruby RegexMatchingExampleExplained.rb < file1.xml | |
# cat file1.xml file2.xml file3.xml | ruby RegexMatchingExampleExplained.rb | |
# ruby RegexMatchingExampleExplained.rb file1.xml file2.xml file3.xml | |
# | |
# Read everything from standard input or from files specified as command line arguments | |
content = ARGF.read |
$ cat test.xml | ruby -r nokogiri -e "puts Nokogiri::XML(ARGF.read).xpath('//article-title').map { |t| t.content.gsub(/\s+/, ' ') }" | wc -l
78
$ cat test.xml | ruby -r nokogiri -e "puts Nokogiri::XML(ARGF.read).xpath('//article-title').map { |t| t.content.gsub(/\s+/, ' ') }"
Chemical Approaches To Perturb, Profile, and Perceive Glycans
On the frequency of protein glycosylation, as deduced from analysis of the SWISS-PROT database
Annotation of glycoproteins in the SWISS-PROT database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*PPD-Adobe: "4.3" | |
*% PPD file for Lexmark T650 with CUPS. | |
*% Created by the CUPS PPD Compiler v1.2.3. | |
*% | |
*% Adobe PostScript(R) Printer Description File | |
*% | |
*% start_copyright | |
*% Produced by Lexmark International, Inc. | |
*% | |
*% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*PPD-Adobe: "4.3" | |
*% Adobe PostScript(R) Printer Description File | |
*% For Lexmark T630 Laser Printers | |
*% Produced by Lexmark International, Inc. | |
*% | |
*% For use with Adobe (formerly Aldus) PageMaker | |
*% | |
*% WARNING: If you edit this file and use it with PageMaker, be sure to | |
*% use an editor (such as DOS Edit) that does NOT add an end-of-file | |
*% marker (hex 1A) when it stores the file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*PPD-Adobe: "4.3" | |
*% Xerox Corporation (R) Printer Description File | |
*% Copyright Xerox Corporation | |
*% Copyright Adobe Systems, Inc. | |
*% All Rights Reserved. | |
*% Date: 07/09/07 | |
*% OPB Build Number: 1.0.4 | |
*% PPD for Windows PPD Only Driver, English | |
*FormatVersion: "4.3" | |
*FileVersion: "1.0" |
NewerOlder