You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.
myString = "abc";
mySubString = myString.substring(0,2);
// ab
200
JavaScript
Datum, Zeit
Aktuelles Datum/Uhrzeit
date = new Date();
// Sat Jun 14 2014 13:15:27 GMT+0200 (CEST)
dateStringISO = date.toISOString();
// "2014-06-14T11:15:27.097Z" // Attention: Time is different because of the timezone
date.toISOString().substring(0,10);
//"2014-06-14"
dateStringISO.split("T")[1];
// 11:15:27.097Z
149
Perl
Datum, Zeit
Jahr aus Datum extrahieren
use POSIX qw/EXIT_SUCCESS EXIT_FAILURE/;
# Datum Vorbereitung:
my $DateTime = POSIX::strftime('%c', localtime(time));
my ($Date, $Time) = split(/\s+/, $DateTime);
my ($Day, $Month, $Year) = split(/\./, $Date);
my ($Hour, $Minute, $Second) = split(/:/, $Time );
my $Datum = "$Year"."$Month"."$Day";
#oder
# my $Datum = "$Day"."$Month"."$Year";
my $Uhrzeit = "$Hour".":"."$Minute".":"."$Second";
182
Batch
Variablen
Deklaration einer Variable
@echo off
SET myVariable=This is my content
SET myPathVariableWithBlanks="C:\Temp\Path With Blanks\File.txt"
echo %myVariable%
REM This is my content
echo %myPathVariableWithBlanks%
REM "C:\Temp\Path With Blanks\File.txt"
183
Batch
Variablen
Wert einer Variable zuweisen
@echo off
cd C:\Temp
REM Aktuelles Verzeichnis in einer Variable setzen
SET mydir="Mein Verzeichnis lautet %CD%"
echo %mydir%
REM "Mein Verzeichnis lautet C:\Temp"
184
Batch
Filehandling
Prüfen ob Datei existiert
@echo off
SET checkFileExists="C:\Temp\myFile.txt"
IF exist %checkFileExists% GOTO :EXISTS
GOTO :EXISTSNOT
:EXISTS
echo There it is :-)
GOTO :END
:EXISTSNOT
echo Sorry, the file isn't there :-(
GOTO :END
:END
echo End of program
198
Batch
Konsolenverwaltung
Einlesen Konsoleneingabe
@echo off
SET mydir=%CD%
set /p number=search this number?:
echo %number% > "%mydir%\lastnumbersearched.txt"
echo dir/b/s *%number%*.*
echo.
echo.
dir/b/s *%number%*.*
echo.
echo.
pause
201
Excel
Strings
Replace
/*
Cell A1 contains text "abc#def"
*/
=SUBSTITUTE(A1;"*";"/")
/*
Result will be: "abc/def"
*/
216
ORACLE PL/SQL
Datum, Zeit
Aktuelles Datum/Uhrzeit
-- if todays date is: 2014-02-02 then a static query would be
SELECT TO_DATE('02/02/2014','dd/mm/yyyy') FROM dual
-- system variable
SELECT SYSDATE AS TODAY FROM SYS."DUAL"
219
ORACLE PL/SQL
Datenmengen
Anzahl Zeilen Resultset begrenzen
SELECT * FROM
(
SELECT * FROM tableA
)
WHERE ROWNUM <= 100