Sponsored Content
Top Forums Shell Programming and Scripting How to count number of files in directory and write to new file with number of files and their name? Post 302741481 by Akshay Hegde on Sunday 9th of December 2012 01:56:44 AM
Old 12-09-2012
How to count number of files in directory and write to new file with number of files and their name?

Hi!

I just want to count number of files in a directory, and write to new text file, with number of files and their name

output should look like this,,

assume that below one is a new file created by script

Code:
Number of files in directory = 25
1. a.txt
2. abc.txt
3. asd.dat
----------------
----------------
----------------
----------------
----------------
----------------
25. last file.dat

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count the number of files in a directory

Hi All, How do i find out the number of files in a directory using unix command ? (14 Replies)
Discussion started by: Raynon
14 Replies

2. Shell Programming and Scripting

count number of files in a directory

what's the script to do that? i want to only count the number of files in that directory, not including any sub directories at all (5 Replies)
Discussion started by: finalight
5 Replies

3. Shell Programming and Scripting

Count the number of files with only the partial file name

I have 1800 files in a directory. The file name is like out_cpty_XXXX. The "XXXX" vaires from file to file. I want to get the count of files with file name out_cpty_XXXX. How to get the count with just the partial file name? Any help would be appreciated? (4 Replies)
Discussion started by: Sangtha
4 Replies

4. UNIX for Dummies Questions & Answers

Read directory files and count number of lines

Hello, I'm trying to create a BASH file that can read all the files in my working directory and tell me how many words and lines are in that file. I wrote the following code: FILES="*" for f in "$FILES" do echo -e `wc -l -w $f` done My issue is that my file is outputting in one... (4 Replies)
Discussion started by: jl487
4 Replies

5. Shell Programming and Scripting

perl script on how to count the total number of lines of all the files under a directory

how to count the total number of lines of all the files under a directory using perl script.. I mean if I have 10 files under a directory then I want to count the total number of lines of all the 10 files contain. Please help me in writing a perl script on this. (5 Replies)
Discussion started by: adityam
5 Replies

6. UNIX for Dummies Questions & Answers

Count number of files in directory excluding existing files

Hi, Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time.. Thanks (3 Replies)
Discussion started by: ammu
3 Replies

7. Shell Programming and Scripting

How to count the number of files starting with a pattern in a Directory

Hi! In our current directory there are around 35000 files. Out of these a few thousands(around 20000) start with, "testfiles9842323879838". I want to count the number of files that have filenames starting with the above pattern. Please help me with the command i could use. Thank... (7 Replies)
Discussion started by: atechcorp
7 Replies

8. UNIX for Dummies Questions & Answers

Write the total number of rows in multiple files into another file

Hello Friends, I know you all are busy and inteligent too... I am stuck with one small issue if you can help me then it will be really great. My problem is I am having some files i.e. Input.txt1 Input.txt2 Input.txt3 Now my task is I need to check the total number of rows in... (4 Replies)
Discussion started by: malaya kumar
4 Replies

9. Shell Programming and Scripting

Count the number of subset of files in a directory

hi I am trying to write a script to count the number of files, with slightly different subset name, in a directory for example, in directory /data, there are a subset of files that are name as follow /data/data_1_(1to however many).txt /data/data_2_(1 to however many).txt... (12 Replies)
Discussion started by: piynik
12 Replies

10. Shell Programming and Scripting

Count number of pattern matches per line for all files in directory

I have a directory of files, each with a variable (though small) number of lines. I would like to go through each line in each file, and print the: -file name -line number -number of matches to the pattern /comp/ for each line. Two example files: cat... (4 Replies)
Discussion started by: pathunkathunk
4 Replies
update-fontlang(8)					       Debian User's Manual						update-fontlang(8)

NAME
update-language, update-fmtutil, update-fmtlang - update various TeX-related configuration files SYNOPSIS
update-language [options] update-fmtutil [options] DESCRIPTION
This manual page explains briefly the usage of the three TeX configuration update programs update-language and update-fmtutil. The update-fontlang script should not be called directly, but only via the two described links. For a more in-depth description, please see the document TeX on Debian in /usr/share/doc/tex-common/TeX-on-Debian.txt.gz (also available as HTML and PDF). The programs update-language and update-fmtutil create or update the configuration files language.dat and fmtutil.cnf, respectively. These files define the hyphenation patterns to be loaded into LaTeX-related TeX formats (language.dat), and the list of formats to be created (fmtutil.cnf). These programs can be used either in system-wide mode if called by root, or in a user-specific mode if called by a user without super-user privileges. OPTIONS
-c DIR, --conf-dir=DIR directory where the user-specific configuration files are looked for in user-specific mode (default TEXMFCONFIG/language.d for update-language and TEXMFCONFIG/fmt.d for update-fmtutil, where TEXMFCONFIG is usually $HOME/.texmf-config). -o FILE, --output-file=FILE file to write the output to. Per default, in system-wide mode, update-language writes to /var/lib/texmf/tex/generic/config/lan- guage.dat and update-fmtutil writes to /var/lib/texmf/web2c/fmtutil.cnf. --checks perform sanity checks on the generated config file. Don't use this in maintainer scripts. --quiet don't write anything to the standard output during normal operation --help print a summary of the command-line usage and exit --version output version information and exit USAGE
In system-wide mode, both programs merge those files ("configuration snippets") with a specific extension in the respective configuration directories to produce the final file. These configuration directories and extensions are language.d and .cnf for update-language, and fmt.d and .cnf for update-fmtutil. In system-wide mode, these directories are those under /etc/texmf/. Both TeX add-on packages and local administrators can add files to these directories. If a package that provides such snippets is removed but not purged, including the snippet will likely break the system. To prevent the inclusion in these cases, snippets installed by packages have to contain a magic header: # -_- DebPkgProvidedMaps -_- which local administrators should not remove. From the files with a magic header, only those files which are also listed in one of the files in /var/lib/tex-common/language-cnf/ for update-language, and /var/lib/tex-common/fmtutil-cnf/ for update-fmtutil, are actually included into the final output file. This way, local changes to the configuration can be preserved while the package is in state 'rc' (that is, the package is removed, but its configuration files are still present). For details about this mechanism, package maintainers should consult the Debian TeX Policy. As a special case, the files for JadeTeX and xmlTeX are only included if there is already a file for the LaTeX format (see TeX on Debian for details). The user-specific mode provides a way for a non-admin user to override system-wide settings. In this mode, update-language writes to TEXM- FVAR/tex/generic/config/language.dat, and update-fmtutil writes to TEXMFVAR/web2c/fmtutil.cnf, where TEXMFVAR is usually $HOME/.texmf-var. Furthermore, files present within the user-specific configuration directories are included in addition to the files present in the system- wide configuration directories. In case the same filename exists in the system-wide configuration directory and the user-specific configu- ration directory, the user-specific file is used instead of the system-wide one. The user-specific configuration directories are TEXMFCON- FIG/language.d for update-language and TEXMFCONFIG/fmt.d for update-fmtutil, where TEXMFCONFIG is usually $HOME/.texmf-config. The system- wide configuration directories have the same names, but are located in /etc/texmf/ instead of TEXMFCONFIG. Note that changes introduced by updates of packages are not propagated to the user's configuration files. This has to be done by hand. FILES
/var/lib/texmf/tex/generic/config/language.dat This file is generated or updated by update-language in system-wide mode and contains a list of the hyphenation patterns loaded into LaTeX-based formats by fmtutil-sys. /var/lib/texmf/web2c/fmtutil.cnf This file is generated or updated by update-fmtutil in system-wide mode and contains a list of formats to be generated by fmtutil- sys. /etc/texmf/language.d/name.cnf Input files for update-language /etc/texmf/fmt.d/name.cnf Input files for update-fmtutil /var/lib/tex-common/language-cnf/package.list Lists the file(s) installed by package in /etc/texmf/language.d/. /var/lib/tex-common/fmtutil-cnf/package.list Lists the file(s) installed by package in /etc/texmf/fmt.d/. SEE ALSO
fmtutil(1), fmtutil-sys(1) The programs actually using the generated configuration files (language.dat and fmtutil.cnf). TeX on Debian Documentation to be found in /usr/share/doc/tex-common/TeX-on-Debian.txt.gz (also available as HTML and PDF), describing in more detail how to setup and maintain a TeX system in Debian. It also includes details on user-specific configuration. Debian TeX Policy to be found in /usr/share/doc/tex-common/Debian-TeX-Policy.txt.gz (also available as HTML and PDF), describing the internals and the TeX Policy established on the Debian TeX mailing-list (debian-tex-maint@lists.debian.org). Intended audience is mainly developers packaging TeX-related resources for Debian. dh_installtex(1) a debhelper-like script for managing the installation of files into the system-wide configuration directories; this script helps to write Debian packages containing TeX-related resources that conform to the Debian TeX Policy. AUTHOR
This manual page was written by Norbert Preining <preining@debian.org> for the Debian distribution (and may be used by others). It was later updated by Florent Rougon <f.rougon@free.fr>. Debian 2006-12-11 update-fontlang(8)
All times are GMT -4. The time now is 01:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy