Manage PlItems

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.

Advanced Search
Displaying 231-240 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
179PHPFilehandlingPrüfen ob Datei existiert$filePath = "/home/myUser/test.txt"; if (file_exists($filePath)) { echo "There it is! ;-)" } else { "Whow, file is missing at this place :-(" }View Update Delete
184BatchFilehandlingPrü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 programView Update Delete
192PythonFilehandlingPrüfen ob Datei existiertimport os filePath="/home/myUser/test.txt" if (os.path.isfile(filePath)): print "There it is! ;-)" else: print "Whow, file is missing at this place :-(" View Update Delete
194PythonFilehandlingFilename-Manipultation Basicsimport os myFilename = "/tmp/Test/myFile.txt" # Get only the path path_only = os.path.dirname(myFilename) # /tmp/Test # Filename only filename_only = os.path.basename(myFilename) # myFile.txt # get only filename without extention filename_without_ext = os.path.basename(os.path.splitext(myFilename)[0]) # myFile # get only the extension filename_extention_only = os.path.splitext(myFilename)[1] # .txt # put them together again myFilename_together = os.path.join(path_only, filename_without_ext + filename_extention_only) # /tmp/Test/myFile.txt View Update Delete
203JavaFilehandlingTernary operatorString thisVar = "OK"; boolean resultVar; resultVar = thisVar.equals("OK") ? true : false; // same as if-else construction if (thisVar.equals("OK")) { resultVar = true; } else { resultVar = false; }View Update Delete
246Bash ScriptFilehandlingFilename-Manipultation Basics#!/bin/sh myFilename="$1" # or myFilename="/tmp/Test/myFile.txt" # Get only the path path_only=$(dirname "$myFilename") # /tmp/Test # if it is a local file in the path, then . will be prompted e.g. myFilename="myFile.txt" # Filename only filename_only=$(basename "$myFilename") # myFile.txt # get only filename without extention filename_without_ext="${filename_only%.*}" # myFile # get only the extension filename_extention_only="${myFilename##*.}" # txt # put them together again myFilename_together="${path_only}/${filename_without_ext}.${filename_extention_only}" # /tmp/Test/myFile.txtView Update Delete
254PowerShellFilehandlingAlle Dateien aus Verzeichnis auslesen$CSVFullPath = "C:\Temp" $FileFilter = "*.csv" $ListOfFiles = (Get-ChildItem -Path $CSVFullPath -Filter $FileFilter) | Select Name, BaseName, DirectoryName, FullName, Extension $ListOfFiles.Name View Update Delete
255PowerShellFilehandlingVerzeichnis rekursiv durchsuchen$CSVFullPath = "C:\Temp" $FileFilter = "*.*" $ListOfFiles = (Get-ChildItem -Path $CSVFullPath -Filter $FileFilter -Recurse) | Select Name, BaseName, DirectoryName, FullName, Extension | Where {$_.DirectoryName -like "*not_processed*" } $ListOfFiles.FullNameView Update Delete
50JavaTypenkonvertierungString in Integer konvertierenString aString = "78"; int aInt = Integer.parseInt(aString);View Update Delete
58JavaTypenkonvertierungInteger nach String konvertierenString numberAsString = ""; int number = 1; numberAsString = String.valueOf(number);View Update Delete