Sponsored Content
Full Discussion: List of file names
Top Forums Shell Programming and Scripting List of file names Post 302494189 by kristinu on Sunday 6th of February 2011 02:59:00 AM
Old 02-06-2011
List of file names

I have the following list of file names stored in $fnames, so that if I do

Code:
 
  foreach f ($fnames)
    echo "$f"
  end

I will get

Code:
n02-z30-sr65-rgdt0p50-dc0p002-16x12drw-run1
n02-z30-sr65-rgdt0p50-dc0p002-16x12drw-run2
n02-z30-sr65-rgdt0p50-dc0p002-16x12drw-run3
n02-z30-sr65-rgdt0p50-dc0p002-16x12drw-run4
n02-z30-sr65-rgdt0p50-dc0p002-16x12drw-run5
n02-z30-sr65-rgdt0p50-dc0p002-16x12drw-run6
n02-z30-sr65-rgdt0p50-dc0p004-16x12drw-run1
n02-z30-sr65-rgdt0p50-dc0p004-16x12drw-run2
n02-z30-sr65-rgdt0p50-dc0p004-16x12drw-run3
n02-z30-sr65-rgdt0p50-dc0p004-16x12drw-run4
n02-z30-sr65-rgdt0p50-dc0p004-16x12drw-run5
n02-z30-sr65-rgdt0p50-dc0p004-16x12drw-run6
n02-z30-sr65-rgdt0p50-dc0p006-16x12drw-run1
n02-z30-sr65-rgdt0p50-dc0p006-16x12drw-run2
n02-z30-sr65-rgdt0p50-dc0p006-16x12drw-run3
n02-z30-sr65-rgdt0p50-dc0p006-16x12drw-run4
n02-z30-sr65-rgdt0p50-dc0p006-16x12drw-run5
n02-z30-sr65-rgdt0p50-dc0p006-16x12drw-run6
n02-z30-sr65-rgdt0p50-dc0p006-16x12drw-run7
n02-z30-sr65-rgdt0p50-dc0p008-16x12drw-run1
n02-z30-sr65-rgdt0p50-dc0p008-16x12drw-run2
n02-z30-sr65-rgdt0p50-dc0p008-16x12drw-run3
n02-z30-sr65-rgdt0p50-dc0p008-16x12drw-run4
n02-z30-sr65-rgdt0p50-dc0p008-16x12drw-run5
n02-z30-sr65-rgdt0p50-dc0p008-16x12drw-run6
n02-z30-sr65-rgdt0p50-dc0p008-16x12drw-run7
n02-z30-sr65-rgdt0p50-dc0p01-16x12drw-run1
n02-z30-sr65-rgdt0p50-dc0p01-16x12drw-run2
n02-z30-sr65-rgdt0p50-dc0p01-16x12drw-run3
n02-z30-sr65-rgdt0p50-dc0p01-16x12drw-run4
n02-z30-sr65-rgdt0p50-dc0p01-16x12drw-run5
n02-z30-sr65-rgdt0p50-dc0p01-16x12drw-run6

I want to create a list of the various filenames without the -run tag.

In other words, I want to have the list

Code:
n02-z30-sr65-rgdt0p50-dc0p002-16x12drw
n02-z30-sr65-rgdt0p50-dc0p004-16x12drw
n02-z30-sr65-rgdt0p50-dc0p006-16x12drw
n02-z30-sr65-rgdt0p50-dc0p008-16x12drw
n02-z30-sr65-rgdt0p50-dc0p01-16x12drw

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Pass a list of file names to ls

Hi I have a list of file names generated from a find command. The list does not show complete file information. I would like to do this: generate the list of file names pass each file name generated to ls -l command what is the best way to do this without a script? I have tried... (2 Replies)
Discussion started by: GMMike
2 Replies

2. AIX

find for specific content in file in the directory and list only file names

Hi, I am trying to find the content of file using grep and find command and list only the file names but i am getting entire file list of files in the directory find . -exec grep "test" {} \; -ls Can anyone of you correct this (2 Replies)
Discussion started by: madhu_Jagarapu
2 Replies

3. UNIX for Dummies Questions & Answers

Get List of Unique File Names

I have a large directory of web pages. I am doing a search through the web pages using grep and would like to get a list of unique file names of search results. The following command works fine to give me a list of file names where term appears: grep -l term *.html However, since these are... (3 Replies)
Discussion started by: rjulich
3 Replies

4. UNIX for Dummies Questions & Answers

Help with list of latest file names

Hi Gurus, I need to list only those files which are most recent and the latest log file. For example if I have the following file list: JOB001.LOG_00uv02_00006 - Jul 7 12:16 JOB001.LOG_00vi0t_00001 - Aug 4 21:58 JOB001.LOG_00vi0t_00002 - Aug 5 09:15 JOB001.LOG_00vi0t_00003 - Aug 5... (6 Replies)
Discussion started by: shash
6 Replies

5. Shell Programming and Scripting

get file names from the list

Hi Experts, Here is my scenario: Am maintaining a file which has list of logs with complete path and file names like bleow a/b/c/Daily/file1_20111012.log d/e/f/Monthly/file1_20111001.log g/h/Daily/file1_20110120.log i/Daily/file1_20110220.log How to copy the file names frm the list... (7 Replies)
Discussion started by: laxm
7 Replies

6. Shell Programming and Scripting

How to get the dates from a list of file names?

Hi All, I have a .txt file with the list of filenames as given below. /dev_data/dev3/ctl/20120622_Employee.txt /dev_data/dev3/ctl/20120623_Employee.txt /dev_data/dev3/ctl/20120624_Employee.txt I want to read this file & write the dates alone from the filenames into a .done file. ... (6 Replies)
Discussion started by: dsfreddie
6 Replies

7. Shell Programming and Scripting

List the file names that differ

Hello, I have two directories - prev and current . They both have same multiple subdirectories and files. Now the current directory can have some updated files and some new files added that is not in prev. I want to find the list of file names that differ. I am doing this because i can not... (2 Replies)
Discussion started by: jakSun8
2 Replies

8. UNIX for Dummies Questions & Answers

List Directory names which have the file

Hi All, Can any one help me to list out the directory names which contain the specified file. See for example File name : file.201307014.LKT Have the directory structure as below. /app/work/data/INDIA/file.201307014.LKT /app/work/data/AMERICA/file.201307014.KTP... (5 Replies)
Discussion started by: Balasankar
5 Replies

9. Shell Programming and Scripting

List the file names available on FTP server before selecting the required file

Below is my script code.which shows the environment name and then fetch the file from the ftp server but I am facing one issue.The script should be run in both way.We can pass the arguments with script and select the environment name then file name.Here the issue is I am not able to list the files... (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies

10. Shell Programming and Scripting

While loop a file containing list of file names until the files are found?

Hi, I have a control file which will contain all filenames(300) files. Loop through all the file names in the control files and check the existence of this file in another directory(same server). I need to infinitely(2 hrs) run this while loop until all the files are found. Once a file is found,... (5 Replies)
Discussion started by: laknar
5 Replies
QUriDrag(3qt)															     QUriDrag(3qt)

NAME
QUriDrag - Drag object for a list of URI references SYNOPSIS
#include <qdragobject.h> Inherits QStoredDrag. Public Members QUriDrag ( QStrList uris, QWidget * dragSource = 0, const char * name = 0 ) QUriDrag ( QWidget * dragSource = 0, const char * name = 0 ) ~QUriDrag () void setFilenames ( const QStringList & fnames ) (obsolete) void setFileNames ( const QStringList & fnames ) void setUnicodeUris ( const QStringList & uuris ) virtual void setUris ( QStrList uris ) Static Public Members QString uriToLocalFile ( const char * uri ) QCString localFileToUri ( const QString & filename ) QString uriToUnicodeUri ( const char * uri ) QCString unicodeUriToUri ( const QString & uuri ) bool canDecode ( const QMimeSource * e ) bool decode ( const QMimeSource * e, QStrList & l ) bool decodeToUnicodeUris ( const QMimeSource * e, QStringList & l ) bool decodeLocalFiles ( const QMimeSource * e, QStringList & l ) DESCRIPTION
The QUriDrag class provides a drag object for a list of URI references. URIs are a useful way to refer to files that may be distributed across multiple machines. A URI will often refer to a file on a machine local to both the drag source and the drop target, so the URI can be equivalent to passing a file name but is more extensible. Use URIs in Unicode form so that the user can comfortably edit and view them. For use in HTTP or other protocols, use the correctly escaped ASCII form. You can convert a list of file names to file URIs using setFileNames(), or into human-readble form with setUnicodeUris(). Static functions are provided to convert between filenames and URIs, e.g. uriToLocalFile() and localFileToUri(), and to and from human- readable form, e.g. uriToUnicodeUri(), unicodeUriToUri(). You can also decode URIs from a mimesource into a list with decodeLocalFiles() and decodeToUnicodeUris(). See also Drag And Drop Classes. MEMBER FUNCTION DOCUMENTATION
QUriDrag::QUriDrag ( QStrList uris, QWidget * dragSource = 0, const char * name = 0 ) Constructs an object to drag the list of URIs in uris. The dragSource and name arguments are passed on to QStoredDrag. Note that URIs are always in escaped UTF8 encoding. QUriDrag::QUriDrag ( QWidget * dragSource = 0, const char * name = 0 ) Constructs an object to drag. You must call setUris() before you start the drag(). Passes dragSource and name to the QStoredDrag constructor. QUriDrag::~QUriDrag () Destroys the object. bool QUriDrag::canDecode ( const QMimeSource * e ) [static] Returns TRUE if decode() would be able to decode e; otherwise returns FALSE. bool QUriDrag::decode ( const QMimeSource * e, QStrList & l ) [static] Decodes URIs from e, placing the result in l (which is first cleared). Returns TRUE if e contained a valid list of URIs; otherwise returns FALSE. Example: dirview/dirview.cpp. bool QUriDrag::decodeLocalFiles ( const QMimeSource * e, QStringList & l ) [static] Decodes URIs from the mime source event e, converts them to local files if they refer to local files, and places them in l (which is first cleared). Returns TRUE if contained a valid list of URIs; otherwise returns FALSE. The list will be empty if no URIs were local files. Example: fileiconview/qfileiconview.cpp. bool QUriDrag::decodeToUnicodeUris ( const QMimeSource * e, QStringList & l ) [static] Decodes URIs from the mime source event e, converts them to Unicode URIs (only useful for displaying to humans), placing them in l (which is first cleared). Returns TRUE if contained a valid list of URIs; otherwise returns FALSE. QCString QUriDrag::localFileToUri ( const QString & filename ) [static] Returns the URI equivalent to the absolute local file filename. See also uriToLocalFile(). void QUriDrag::setFileNames ( const QStringList & fnames ) Sets the URIs to be the local-file URIs equivalent to fnames. See also localFileToUri() and setUris(). Example: dirview/dirview.cpp. void QUriDrag::setFilenames ( const QStringList & fnames ) This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. Use setFileNames() instead (notice the N). void QUriDrag::setUnicodeUris ( const QStringList & uuris ) Sets the URIs in uuris to be the Unicode URIs (only useful for displaying to humans). See also localFileToUri() and setUris(). void QUriDrag::setUris ( QStrList uris ) [virtual] Changes the list of uris to be dragged. Note that URIs are always in escaped UTF8 encoding. QCString QUriDrag::unicodeUriToUri ( const QString & uuri ) [static] Returns the URI equivalent of the Unicode URI given in uuri (only useful for displaying to humans). See also uriToLocalFile(). QString QUriDrag::uriToLocalFile ( const char * uri ) [static] Returns the name of a local file equivalent to uri or a null string if uri is not a local file. Note that URIs are always in escaped UTF8 encoding. See also localFileToUri(). Example: dirview/dirview.cpp. QString QUriDrag::uriToUnicodeUri ( const char * uri ) [static] Returns the Unicode URI (only useful for displaying to humans) equivalent of uri. Note that URIs are always in escaped UTF8 encoding. See also localFileToUri(). SEE ALSO
http://doc.trolltech.com/quridrag.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (quridrag.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QUriDrag(3qt)
All times are GMT -4. The time now is 10:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy