Sponsored Content
Top Forums Shell Programming and Scripting [Urgent]how to print the file names into a txt file??? Post 302110088 by dennis.jacob on Saturday 10th of March 2007 01:15:03 AM
Old 03-10-2007
find <directory> -type f -maxdepth 1 -print >temp_file
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed script to print a value from txt file

Hello guys, I would appreciate if someone can help me to write a shell script using sed. From a larget text file I need to print a fixed value of a word. In another words whenever it finds that word, it needs to grab the other line containing "dn" and prints its value. For example: dn:... (7 Replies)
Discussion started by: cmontr
7 Replies

2. Shell Programming and Scripting

print all even lines of a txt file

In other news, I have a colors text file with hundreds of lines, and I want to print only the even numbered lines. for example I have this file looks something like this: ALLCOLORS.TXT red red green red blue red red red green red red blue green green green blue blue blue red blue blue blue... (1 Reply)
Discussion started by: ajp7701
1 Replies

3. Shell Programming and Scripting

Urgent Need Help! Merging lines in .txt file

I need to write a script that reads through an input .txt file and replaces the end value with the end value of the next line for lines that have distance <=4000. The first label line is not actually in the input. In the below example, 3217 is the distance from the end of the first line to the... (12 Replies)
Discussion started by: awknerd
12 Replies

4. Shell Programming and Scripting

Finding consecutive numbers in version names on a txt file

Hi all. I have a directory which contains files that can be versioned. All the files are named according to a pattern like this: TEXTSTRING1-001.EXTENSION TEXTSTRING2-001.EXTENSION TEXTSTRING3-001.EXTENSION ... TEXTSTRINGn-001.EXTENSION If a file is versioned, a file called ... (10 Replies)
Discussion started by: fox1212
10 Replies

5. Shell Programming and Scripting

Print numbers along with file names.

Hi All, I have some thousand files with names like 1.syl, 2.syl, 5.syl etc. These files contain one sentence each. I want to store all those sentences along with the file ID that is 1, 2, 5 with the sentences they contain. For example, 1.syl has this is a test line 2.syl has ... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

6. Shell Programming and Scripting

awk to print value from txt file to csv

Hi, I want to print two columns from a .txt file to a .csv file using awk. data in text file: Application -------------------------------------------------- ----------- OS Related Issues 1 EMEA Solutions ... (8 Replies)
Discussion started by: prashu_g
8 Replies

7. UNIX for Dummies Questions & Answers

Delete files whose file names are listed in a .txt file

hi, I need a help. I used this command to list all the log files which are for more than 10 days to a text file. find /usr/script_test -type f -mtime +10>>/usr/ftprm.txt I want all these files listed in the ftprm.txt to be ftp in another machine and then rm the files. Anyone can help me... (8 Replies)
Discussion started by: kamaldev
8 Replies

8. Shell Programming and Scripting

Print file names in a loop

OS : RHEL 6.1 Shell : Bash I have lots of files in /tmp/stage directory as show below. Using a loop, I need to print all the filenames in this directory except those ending with a number. How can I do this ? # pwd /tmp/stage # # # ls -l * -rw-r--r--. 1 root root 0 Oct 7 18:38 stmt1... (2 Replies)
Discussion started by: kraljic
2 Replies

9. Shell Programming and Scripting

**URGENT ** : Comparing the pattern of the file names in 2 different directories

Hi, I have got a requirement for which i need your help. The following problem is required to get solved in PERL SCRIPT. Here is the requirement. There are 4 folders say SRC_DIR1, SRC_DIR2 and TGT_DIR_1,TGT_DIR_2 (Note: both path of SRC_DIR1 & SRC_DIR2 are different but both path of... (1 Reply)
Discussion started by: shadow_fawkes
1 Replies

10. Shell Programming and Scripting

Print the output with different file names

I have a python script that gives output called test.png. By using the following command I run the script every 2 seconds. What is the easiest way to save the output as follows ( test.png (1st output), tes1.png (second output), tes2.png ....) Command I i use while sleep 2; do python... (1 Reply)
Discussion started by: quincyjones
1 Replies
Filename(3)							   OCaml library						       Filename(3)

NAME
Filename - Operations on file names. Module Module Filename Documentation Module Filename : sig end Operations on file names. val current_dir_name : string The conventional name for the current directory (e.g. . in Unix). val parent_dir_name : string The conventional name for the parent of the current directory (e.g. .. in Unix). val dir_sep : string The directory separator (e.g. / in Unix). Since 3.11.2 val concat : string -> string -> string concat dir file returns a file name that designates file file in directory dir . val is_relative : string -> bool Return true if the file name is relative to the current directory, false if it is absolute (i.e. in Unix, starts with / ). val is_implicit : string -> bool Return true if the file name is relative and does not start with an explicit reference to the current directory ( ./ or ../ in Unix), false if it starts with an explicit reference to the root directory or the current directory. val check_suffix : string -> string -> bool check_suffix name suff returns true if the filename name ends with the suffix suff . val chop_suffix : string -> string -> string chop_suffix name suff removes the suffix suff from the filename name . The behavior is undefined if name does not end with the suffix suff . val chop_extension : string -> string Return the given file name without its extension. The extension is the shortest suffix starting with a period and not including a directory separator, .xyz for instance. Raise Invalid_argument if the given name does not contain an extension. val basename : string -> string Split a file name into directory name / base file name. If name is a valid file name, then concat (dirname name) (basename name) returns a file name which is equivalent to name . Moreover, after setting the current directory to dirname name (with Sys.chdir ), references to basename name (which is a relative file name) designate the same file as name before the call to Sys.chdir . This function conforms to the specification of POSIX.1-2008 for the basename utility. val dirname : string -> string See Filename.basename . This function conforms to the specification of POSIX.1-2008 for the dirname utility. val temp_file : ?temp_dir:string -> string -> string -> string temp_file prefix suffix returns the name of a fresh temporary file in the temporary directory. The base name of the temporary file is formed by concatenating prefix , then a suitably chosen integer number, then suffix . The optional argument temp_dir indicates the tempo- rary directory to use, defaulting to the current result of Filename.get_temp_dir_name . The temporary file is created empty, with permis- sions 0o600 (readable and writable only by the file owner). The file is guaranteed to be different from any other file that existed when temp_file was called. Raise Sys_error if the file could not be created. Before3.11.2 no ?temp_dir optional argument val open_temp_file : ?mode:Pervasives.open_flag list -> ?temp_dir:string -> string -> string -> string * Pervasives.out_channel Same as Filename.temp_file , but returns both the name of a fresh temporary file, and an output channel opened (atomically) on this file. This function is more secure than temp_file : there is no risk that the temporary file will be modified (e.g. replaced by a symbolic link) before the program opens it. The optional argument mode is a list of additional flags to control the opening of the file. It can contain one or several of Open_append , Open_binary , and Open_text . The default is [Open_text] (open in text mode). Raise Sys_error if the file could not be opened. Before3.11.2 no ?temp_dir optional argument val get_temp_dir_name : unit -> string The name of the temporary directory: Under Unix, the value of the TMPDIR environment variable, or "/tmp" if the variable is not set. Under Windows, the value of the TEMP environment variable, or "." if the variable is not set. The temporary directory can be changed with File- name.set_temp_dir_name . Since 4.00.0 val set_temp_dir_name : string -> unit Change the temporary directory returned by Filename.get_temp_dir_name and used by Filename.temp_file and Filename.open_temp_file . Since 4.00.0 val temp_dir_name : string Deprecated. The name of the initial temporary directory: Under Unix, the value of the TMPDIR environment variable, or "/tmp" if the vari- able is not set. Under Windows, the value of the TEMP environment variable, or "." if the variable is not set. This function is depre- cated; Filename.get_temp_dir_name should be used instead. Since 3.09.1 val quote : string -> string Return a quoted version of a file name, suitable for use as one argument in a command line, escaping all meta-characters. Warning: under Windows, the output is only suitable for use with programs that follow the standard Windows quoting conventions. OCamldoc 2014-06-09 Filename(3)
All times are GMT -4. The time now is 11:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy