Unix Script - Move and Unzip Files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix Script - Move and Unzip Files
# 1  
Old 10-28-2009
Question Unix Script - Move and Unzip Files

Requirement Details:
We have a folder named 'Inbound Files' that has many folders in it containing source files that have to be processed by Informatica system. We have zipped files, text files and csv files in those folders that have to be moved (cut and paste) from 'Inbound_Files' folder to 'Src_Files' folder.

Now the zipped files in 'Src_Files' folder have to be unzipped in the same folder having a list file created.
For example:
We have a zipped file named as Data_File.GZ that contains File1.txt, File2.txt and File3.txt zipped in it. Post unzip unlike the number of resultant files, the file names have to be added into a list file named Data_File.lst - this list file will have the resultant file names (say - Data_File.lst should contain
File1.txt
File2.txt
File3.txt one below the other)

Please assist
# 2  
Old 10-28-2009
What is the problem? What did you do so far? This sounds like normal Unix/Linux shell tasks.
# 3  
Old 10-28-2009
Hi Zaxxon,

Moving the files from a folder to other is done, I just wanted to know how should I create those *.lst files after unzipping them?

Thanks
Mano
# 4  
Old 10-28-2009
Code:
ls -1 > that.lst

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Move, unzip, backup

#!/bin/bash set -xv errdir=/apps/awd/RPMSReportParser/dist/error attach=/apps/awd/rip-optumprod/poller/attach backup=/apps/awd/rip-optumprod/pollerstage/backup/ log=~/catcher.log exec >>"$log" 2>&1 date >>"$log" cd $errdir for i in *.zip*; do cp -p $errdir/"$i" "$backup"; ... (2 Replies)
Discussion started by: xgringo
2 Replies

2. Shell Programming and Scripting

Script to unzip files and Rename the Output-files

Hi all, I have a many folders with zipped files in them. The zipped files are txt files from different folders. The txt files have the same names. If i try to find . -type f -name "*.zip" -exec cp -R {} /myhome/ZIP \; it fails since the ZIP files from different folders have the same names and... (2 Replies)
Discussion started by: pmkenya
2 Replies

3. Shell Programming and Scripting

Unzip the .zip file without using unzip utility in UNIX

I have .zip file, i want to list all the files archived in the zip file. unzip utility is not working for me in unix. Please help me resolve this issue Thanks ganesh. (3 Replies)
Discussion started by: Ganesh L
3 Replies

4. Shell Programming and Scripting

Using Shell Script in place of Perl script to Unzip the zip files.

Hi Expert, We have some shell scripts which Internally uses Perl Script to Unzip the source zip files which comes to inbound directory. So now our requirement is to avoid the dependency on Perl Script and us Shell Script to unzip the files. I have the Perl script with me attached can some one... (3 Replies)
Discussion started by: naveen.dasu
3 Replies

5. Shell Programming and Scripting

How to unzip files from folder in shell script (ksh)?

I have a folder (C:\shellprg\input\) containing .CSV, .zip, .gz files. 1] I want to find all .zip/.gz files from folder (C:\shellprg\input\). 2] unzip/uncompress files into the same folder (C:\shellprg\input\) through shell script. I am using below commands for unzip files, unzip <filename>... (2 Replies)
Discussion started by: Poonamol
2 Replies

6. Shell Programming and Scripting

Unix Script To Move Files Based On Grep

I am looking for advice on how to write a script that will rename and/or move files to a different directory based upon the results of a grep. Let's say I have ten files in a directory. Some of them - not all - contain the text 'HELLO'. I would like to be able to grep the files for that text,... (3 Replies)
Discussion started by: rjhjr64
3 Replies

7. Shell Programming and Scripting

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

8. Shell Programming and Scripting

Script to unzip specific files

As part of an audit at work I need to review a lot of Windows workstations. One thing I need to do is review all of the .doc files. My problem is that I guessed a number of these files would be in zip archives. This is the case but they are mixed in with a lot of other file types that I am not... (1 Reply)
Discussion started by: stumpyuk
1 Replies

9. HP-UX

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

10. Shell Programming and Scripting

Problems writing bash script to unzip files

I'm getting the following errors when I try to write a script to unzip some zip files. When I use the free trial copy of the commerical winzip program, however, they work fine. When I use -l or -t on unzip it indicates no errors. When I use the -o switch interactively from the bash command line it... (1 Reply)
Discussion started by: siegfried
1 Replies
Login or Register to Ask a Question