03-15-2013
Quote:
Originally Posted by
PikK45
@ctsgnb:
n=$(unzip -lqq $i | awk '{print $NF}') could have used basename for this
![Smilie Smilie](https://www.unix.com/images/smilies/smile.gif)
@Pikk45
Wrong : basename would have given the name of the zip file, and not the name of the csv file that is in the zip archive .
![Wink Smilie](https://www.unix.com/images/smilies/wink.gif)
This User Gave Thanks to ctsgnb For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
example test1 will have m1234567.12a
I would like to rename in batch but I don't Please help me on this.
cd /a1/a2/a3
test1=$(basename /a1/a2/a3/*.*) >> /tmp/t
echo $test1
echo "Extracting 8 th position" >> /tmp/t2
awk '{print substr($1,8,1); }' $test1 >> /tmp/t3
echo "extraction ... (3 Replies)
Discussion started by: kathy18
3 Replies
2. HP-UX
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
3. UNIX for Advanced & Expert Users
In my dir there are files like
a.xml
b.xml
abnc.xml
12.abc.xml
12.anc.sfoioi.xml
I need to remove .xml from all the files
Is there any direct way without using any for/do loop
Right now i am using
for file in *
do
... (7 Replies)
Discussion started by: reldb
7 Replies
4. Shell Programming and Scripting
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
5. UNIX for Dummies Questions & Answers
I would like to replace multiple underscores with hyphens but I have 26,000 files to rename. They are all in one file structure and multiple sub-directories.
It would be much simpler if I had a script to do it. Here are some samples of the file names:
Example 1... (3 Replies)
Discussion started by: ..Chris..
3 Replies
6. Shell Programming and Scripting
Hello all
I am trying to do a script that would allow me to mass rename files after a grep search within them. They are XML files and the pattern I would like to append to the file name is easy to find (e.g. <filename>foo</filename>), but I can't for the life of me find out how to do it and... (2 Replies)
Discussion started by: aavv
2 Replies
7. Shell Programming and Scripting
hi gooday
I need some help with a rename I am attempting.
I'd like to rename a bunch of files in a folder
example
list.dat.old to list_N.dat
query.dat.old to query_N.dat
note the two periods in (.dat.old) to become _N.dat
I tried using sed like this
ls *.dat.old | sed... (3 Replies)
Discussion started by: johnstrong
3 Replies
8. Shell Programming and Scripting
Hi all,
I do not have programming experience and mostly use one-liner or sometimes more to get the job done. I am having problem to batch rename the files that do not match a particular pattern.
Sample file-names from directory:
Meeting_Packages.pdf 13_textfile0 19_textfile0 ... (3 Replies)
Discussion started by: atulkakrana
3 Replies
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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
LEARN ABOUT CENTOS
zip_errors
ZIP_ERRORS(3) Library Functions Manual ZIP_ERRORS(3)
NAME
zip_errors - list of all libzip error codes
LIBRARY
libzip (-lzip)
SYNOPSIS
#include <zip.h>
DESCRIPTION
The following error codes are used by libzip:
[ZIP_ER_OK] No error.
[ZIP_ER_MULTIDISK] Multi-disk zip archives not supported.
[ZIP_ER_RENAME] Renaming temporary file failed.
[ZIP_ER_CLOSE] Closing zip archive failed.
[ZIP_ER_SEEK] Seek error.
[ZIP_ER_READ] Read error.
[ZIP_ER_WRITE] Write error.
[ZIP_ER_CRC] CRC error.
[ZIP_ER_ZIPCLOSED] Containing zip archive was closed.
[ZIP_ER_NOENT] No such file.
[ZIP_ER_EXISTS] File already exists.
[ZIP_ER_OPEN] Can't open file.
[ZIP_ER_TMPOPEN] Failure to create temporary file.
[ZIP_ER_ZLIB] Zlib error.
[ZIP_ER_MEMORY] Malloc failure.
[ZIP_ER_CHANGED] Entry has been changed.
[ZIP_ER_COMPNOTSUPP] Compression method not supported.
[ZIP_ER_EOF] Premature EOF.
[ZIP_ER_INVAL] Invalid argument.
[ZIP_ER_NOZIP] Not a zip archive.
[ZIP_ER_INTERNAL] Internal error.
[ZIP_ER_INCONS] Zip archive inconsistent.
[ZIP_ER_REMOVE] Can't remove file.
[ZIP_ER_DELETED] Entry has been deleted.
[ZIP_ER_ENCRNOTSUPP] Encryption method not supported.
[ZIP_ER_RDONLY] Read-only archive.
[ZIP_ER_NOPASSWD] No password provided.
[ZIP_ER_WRONGPASSWD] Wrong password provided.
AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at>
NiH March 10, 2009 ZIP_ERRORS(3)