Sponsored Content
Top Forums Shell Programming and Scripting Removing last character from each line of file Post 62654 by vgersh99 on Friday 18th of February 2005 09:34:15 AM
Old 02-18-2005
and if you use '-b' or '-B'?
I'm not a real guru when it comes to 'unzip' - just reading 'man unzip'.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing character from list line (at the end)

Hi, I have file as shown below. abc, def, abc, xyz, I have to remove ',' from end of last line (xyz,). How can I do that with single command? Is it possible or I have to iterate through complete file to remove that? - Malay (2 Replies)
Discussion started by: malaymaru
2 Replies

2. Shell Programming and Scripting

removing new line character

I'm appending header and trailer record for a binary file using echo "$header" > filename cat oldfilename >> filename echo "$trailer" >> filename The echo is introducing newline character after header and trailer.Please let me know is there any possibility to get rid of newline character. (2 Replies)
Discussion started by: ammu
2 Replies

3. UNIX for Dummies Questions & Answers

removing a character and addending to end in each line in a file

HI i am having a file this (sys19:pnlfct:/pfact/temp>) cat temp_sand 1234567890 1234567890 1234567890 1234567890 I want to make this file as (sys19:pnlfct:/pfact/temp>) cat temp_sand 1456789023 1456789023 1456789023 1456789023 just take the 2nd and 3rd position and put it... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

4. Shell Programming and Scripting

How to concat line first and then removing the ^M character

hi Someone can give me some clue or script in writing the below requirement I am having 5 or 10 files of unix files which contain ^M charactes. First we have to find ^M character and concat the line where it has broken and then we have to remove the ^M character from the uxix... (11 Replies)
Discussion started by: vsantoshusa
11 Replies

5. Shell Programming and Scripting

Removing ^Z Character in a File

Hi, I am having a pipe (|) delimited file which is having ^Z character in the middle of the text.Could anyone please suggest me how to remove this ^Z Character from the file.I almost used all the ideas posted in this site but none of them worked in my case since tis ^Z character is not coming at... (4 Replies)
Discussion started by: phoenix86
4 Replies

6. Shell Programming and Scripting

Removing Special Character from File.

Hi, My file has this special character "^M" I would like to remove this characters. eg: abc,abc,^M i tried using sed but doesnt work. i used octal dump command to see special character it returns following: 015 \r Appreciate your reply. (6 Replies)
Discussion started by: pinnacle
6 Replies

7. HP-UX

How to remove new line character and append new line character in a file?

Hi Experts, I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line. File is comma (,) seperated. Eg: ID,Client ,SNo,Rank 37,Airtel \n... (8 Replies)
Discussion started by: sasikari
8 Replies

8. UNIX for Dummies Questions & Answers

Need help removing last character of every line if certain character

I need help removing the last character of every line if it is a certain character. For example I need to get rid of a % character if it is in the last position. Input: aaa% %bbb ccc d%dd% Output should be: aaa %bbb ccc d%dd I tried this but it gets rid of all of the % characters.... (5 Replies)
Discussion started by: raptor25
5 Replies

9. Shell Programming and Scripting

Removing first and last character of line

Hi all, Please help me to remove first and last character of each line in a file. Thanks, Baski (5 Replies)
Discussion started by: baskivs
5 Replies

10. Shell Programming and Scripting

Removing last character of a specific line from a file

Hello guys, I would need to remove the last character ")" of a specific line. This can be from any line. Your help is appreciated. Below is the line. HOSTNAME=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)) Please help. (6 Replies)
Discussion started by: sang8g
6 Replies
UNZIP(1)						    BSD General Commands Manual 						  UNZIP(1)

NAME
unzip -- extract files from a ZIP archive SYNOPSIS
unzip [-aCcfjLlnopqtuv] [-d dir] zipfile DESCRIPTION
The following options are available: -a When extracting a text file, convert DOS-style line endings to Unix-style line endings. -C Match file names case-insensitively. -c Extract to stdout/screen. When extracting files from the zipfile, they are written to stdout. This is similar to -p, but does not suppress normal output. -d dir Extract files into the specified directory rather than the current directory. -f Update existing. Extract only files from the zipfile if a file with the same name already exists on disk and is older than the former. Otherwise, the file is silently skipped. -j Ignore directories stored in the zipfile; instead, extract all files directly into the extraction directory. -L Convert the names of the extracted files and directories to lowercase. -l List, rather than extract, the contents of the zipfile. -n No overwrite. When extracting a file from the zipfile, if a file with the same name already exists on disk, the file is silently skipped. -o Overwrite. When extracting a file from the zipfile, if a file with the same name already exists on disk, the existing file is replaced with the file from the zipfile. -p Extract to stdout. When extracting files from the zipfile, they are written to stdout. The normal output is suppressed as if -q was specified. -q Quiet: print less information while extracting. -t Test: do not extract anything, but verify the checksum of every file in the archive. -u Update. When extracting a file from the zipfile, if a file with the same name already exists on disk, the existing file is replaced with the file from the zipfile if and only if the latter is newer than the former. Otherwise, the file is silently skipped. -v List verbosely, rather than extract, the contents of the zipfile. This differs from -l by using the long listing. Note that most of the data is currently fake and does not reflect the content of the archive. -x pattern Exclude files matching the pattern pattern. -Z mode Emulate zipinfo(1L) mode. Enabling zipinfo(1L) mode changes the way in which additional arguments are parsed. Currently only zipinfo(1L) mode 1 is supported, which lists the file names one per line. Note that only one of -n, -o, and -u may be specified. If specified filename is "-", then data is read from stdin. ENVIRONMENT
If the UNZIP_DEBUG environment variable is defined, the -q command-line option has no effect, and additional debugging information will be printed to stderr. COMPATIBILITY
The unzip utility aims to be sufficiently compatible with other implementations to serve as a drop-in replacement in the context of the ports(7) system. No attempt has been made to replicate functionality which is not required for that purpose. For compatibility reasons, command-line options will be recognized if they are listed not only before but also after the name of the zipfile. Normally, the -a option should only affect files which are marked as text files in the zipfile's central directory. Since the archive(3) library reads zipfiles sequentially, and does not use the central directory, that information is not available to the unzip utility. Instead, the unzip utility will assume that a file is a text file if no non-ASCII characters are present within the first block of data decompressed for that file. If non-ASCII characters appear in subsequent blocks of data, a warning will be issued. The unzip utility is only able to process ZIP archives handled by libarchive(3). Depending on the installed version of libarchive, this may or may not include self-extracting archives. SEE ALSO
libarchive(3) HISTORY
The unzip utility appeared in FreeBSD 8.0. AUTHORS
The unzip utility and this manual page were written by Dag-Erling Smorgrav <des@FreeBSD.org>. It uses the archive(3) library developed by Tim Kientzle <kientzle@FreeBSD.org>. BSD
May 10, 2012 BSD
All times are GMT -4. The time now is 06:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy