Sponsored Content
Top Forums Programming how to get all files on a directory of .c file Post 302715051 by spacebar on Saturday 13th of October 2012 03:38:54 PM
Old 10-13-2012
I don't know what language your using(i.e. shell script, perl, vb, etc.) but the below will give you a list of files:
Code:
cd .c
for f in `ls *.txt`
do
  file=`echo ${f}`
  .......your code to process file.......
done

 

10 More Discussions You Might Find Interesting

1. Solaris

Copy files from the file to another directory

I have created a file that has list of all the files I want to copy into another directory.Is there a way to do it? Thanks In advance (4 Replies)
Discussion started by: shreethik
4 Replies

2. Shell Programming and Scripting

ls > file - Creating file containing the list of all files present in a directory

Hi All, I need to create a file which contains the list of all the files present in that directory. e.g., ls /export/home/user/*.dat > list_file.dat but what i am getting is: $ ls /export/home/user/*.dat > list_file.dat /export/home/user/*.dat: No such file or directory But I have... (1 Reply)
Discussion started by: pranavagarwal
1 Replies

3. UNIX for Dummies Questions & Answers

Creating a file to count how many files in the directory

hello there i want to creat a file that count how many files i have in the directory. for this i use the command find . -type f | wc -l > 1In1.myfile the problem with this command is that it not update after i add a new file in the directory. Anyone got any ideas how i can... (5 Replies)
Discussion started by: AntiPin
5 Replies

4. Shell Programming and Scripting

Getting the total file size for certain files per directory

Hi, I am trying to get the total file size for certain files per directory. I am using find /DirectoryPath -name '*.dta' -exec ls -l {} \; | awk '{ print $NF ": " $5 }' > /users/cergun/My\ Documents/dtafiles.txt but this lists all the files in the directories. I need the total... (9 Replies)
Discussion started by: cergun
9 Replies

5. UNIX for Dummies Questions & Answers

No such file or directory error while copying files

Hi, I need to copy files from one dir to another dir. The list of filesnames to be moved are in a file called files2cp.log Script: #!/bin/ksh exec 0</home/amdocs/files2cp.log while read LINE do cp -i /iccs33/attach/"$LINE" /iccs30/attach/"$LINE" done The output is "No such... (6 Replies)
Discussion started by: srinirsr
6 Replies

6. Shell Programming and Scripting

Script which removes files from the first directory if there is a file in the second directory

Script must removes files from the first directory if there is a file with same name in the second directory Script passed to the two directories, it lies with them in one directory: sh script_name dir1 dir2 This is my version, but it does not work :wall: set - $2/* for i do set -... (6 Replies)
Discussion started by: SLAMUL
6 Replies

7. Shell Programming and Scripting

Grepping file names, comparing them to a directory of files, and moving them into a new directory

got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies

8. Shell Programming and Scripting

Parse files in directory and compare with another file

I have two files File 1 in reading directory is of following format Read 1 A T Read 3 T C Read 5 G T Read 7 A G Read 10 A G Read 12 C G File 2 in directory contains Read 5 A G Read 6 T C Read 7 G A Read 8 G A Read 20 A T File2 contains (1 Reply)
Discussion started by: empyrean
1 Replies

9. Shell Programming and Scripting

Delete all files from the directory except the ones in the log file

I have a log file with contents like below. Repository: https://someserver:9443/ Workspace: (1000) "test_scripts_ws" Component: (1001) "some_Automated_Scripts" Change sets: (1002) ---$ john "test memory" 17-Sep-2014 02:24 PM Changes: --a--... (9 Replies)
Discussion started by: gaurav99
9 Replies

10. Shell Programming and Scripting

Directory containing files,Print names of the files in the directory that are exactly same content.

Given a directory containing say a few thousand files, please output a list of all the names of the files in the directory that are exactly the same, i.e. have the same contents. func(a_directory_name) output -> {“matches”: , ... ]} e.g. func(“/home/my/files”) where the directory... (7 Replies)
Discussion started by: anuragpgtgerman
7 Replies
Locale::Msgfmt(3pm)					User Contributed Perl Documentation				       Locale::Msgfmt(3pm)

NAME
Locale::Msgfmt - Compile .po files to .mo files SYNOPSIS
This module does the same thing as msgfmt from GNU gettext-tools, except this is pure Perl. The interface is best explained through examples: use Locale::Msgfmt; # Compile po/fr.po into po/fr.mo msgfmt({in => "po/fr.po", out => "po/fr.mo"}); # Compile po/fr.po into po/fr.mo and include fuzzy translations msgfmt({in => "po/fr.po", out => "po/fr.mo", fuzzy => 1}); # Compile all the .po files in the po directory, and write the .mo # files to the po directory msgfmt("po/"); # Compile all the .po files in the po directory, and write the .mo # files to the po directory, and include fuzzy translations msgfmt({in => "po/", fuzzy => 1}); # Compile all the .po files in the po directory, and write the .mo # files to the output directory, creating the output directory if # it doesn't already exist msgfmt({in => "po/", out => "output/"}); # Compile all the .po files in the po directory, and write the .mo # files to the output directory, and include fuzzy translations msgfmt({in => "po/", out => "output/", fuzzy => 1}); # Compile po/fr.po into po/fr.mo msgfmt("po/fr.po"); # Compile po/fr.po into po/fr.mo and include fuzzy translations msgfmt({in => "po/fr.po", fuzzy => 1}); COPYRIGHT &; LICENSE Copyright 2009 Ryan Niebur, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-01-21 Locale::Msgfmt(3pm)
All times are GMT -4. The time now is 05:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy