Top "File" questions

A block of arbitrary information, or resource for storing information, accessible by the string-based name or path.

How do I get the directory from a file's full path?

What is the simplest way to get the directory that a file is in? I'm using this to set a …

c# .net file file-io directory
Limit file format when using <input type="file">?

I'd like to restrict the type of file that can be chosen from the native OS file chooser when the …

html file types
How to read file from relative path in Java project? java.io.File cannot find the path specified

I have a project with 2 packages: tkorg.idrs.core.searchengines tkorg.idrs.core.searchengines In package (2) I have a text …

java file
Find duplicate lines in a file and count how many time each line was duplicated?

Suppose I have a file similar to the following: 123 123 234 234 123 345 I would like to find how many times '123' was …

file count find duplicates lines
How do I get the path and name of the file that is currently executing?

I have scripts calling other script files but I need to get the filepath of the file that is currently …

python scripting file
How to remove files and directories quickly via terminal (bash shell)

From terminal window: When I use the rm command it can only remove files. When I use the rmdir command …

file terminal directory rm rmdir
How to split a large text file into smaller files with equal number of lines?

I've got a large (by number of lines) plain text file that I'd like to split into smaller files, also …

bash file unix
How do I get the file name from a String containing the Absolute file path?

String variable contains a file name, C:\Hello\AnotherFolder\The File Name.PDF. How do I only get the file …

java file filenames filepath
Open file in a relative location in Python

Suppose python code is executed in not known by prior windows directory say 'main' , and wherever code is installed when …

python file path relative-path
Search and replace a line in a file in Python

I want to loop over the contents of a text file and do a search and replace on some lines …

python file