[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Reading all files from a path



Under the Korn shell:

/tmp/demo>for i in `ls *PY*txt`;do
> j=${i#*_}               
> cat $i >> $j
> done


>>> "Knapp, Richard" <KnappR@umsystem.edu> 8/31/2006 9:57 AM >>>

I would use an operating system utility to do this.

Richard Knapp
AITS - Reporting
University of Missouri
Locust Street Building
Columbia, MO 65201
573-882-8856
knappr@umsystem.edu 

-----Original Message-----
From: sqr-users-bounces+knappr=umsystem.edu@sqrug.org 
[mailto:sqr-users-bounces+knappr=umsystem.edu@sqrug.org] On Behalf Of
Vaidyanathan, Ramakrishnan (GE, Corporate,consultant)
Sent: Thursday, August 31, 2006 7:44 AM
To: sqr-users@sqrug.org 
Subject: [sqr-users] Reading all files from a path

Hi,

   I have set of text files available in a specific path. I need to
merge all those text files into one single file. Those text files all
start with a date indicating when they have been run. Apart from the
date the file name also has some specific naming conventions like it
shud start with PY and so on. For eg. the file name will be
20060606_PY_A.txt, 20060610_PY_A.txt, 20060606_PY_B.txt,
20060610_PY_B.txt and so on. Is it possible to merge all those files
into one specific file for each category. For the eg mentioned after
merging files, the file names should be PY_A.txt (this is a result of
merging 2 files 20060606_PY_A.txt, 20060610_PY_A.txt), PY_B.txt (as a
result of merging 2 files 20060606_PY_B.txt, 20060610_PY_B.txt ).

Pls help

Thanks
Ram

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users