Sponsored Content
Top Forums Shell Programming and Scripting Removing last character from each line of file Post 62652 by vgersh99 on Friday 18th of February 2005 09:22:54 AM
Old 02-18-2005
do you have TWO files to transfer or ONE zip?

if you have 2, transfer zip in binary and others in ascii.

AM I misisng the point here?
 

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
FORTUNE(6)							 BSD Games Manual							FORTUNE(6)

NAME
fortune -- print a random, hopefully interesting, adage SYNOPSIS
fortune [-aefilosw] [-m pattern] [[N%] file/dir/all] DESCRIPTION
When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories, where each category is subdivided into those which are potentially offensive and those which are not. The options are as follows: -a Choose from all lists of maxims, both offensive and not. (See the -o option for more information on offensive fortunes.) -e Consider all fortune files to be of equal size (see discussion below on multiple files). -f Print out the list of files which would be searched, but don't print a fortune. -i Ignore case for -m patterns. -l Long dictums only. -m pattern Print out all fortunes which match the regular expression pattern. See regex(3) for a description of patterns. -o Choose only from potentially offensive aphorisms. Please, please, please request a potentially offensive fortune if and only if you believe, deep down in your heart, that you are willing to be offended. (And that if you are, you'll just quit using -o rather than give us grief about it, okay?) ... let us keep in mind the basic governing philosophy of The Brotherhood, as handsomely summarized in these words: we believe in healthy, hearty laughter -- at the expense of the whole human race, if needs be. Needs be. --H. Allen Smith, "Rude Jokes" -s Short apothegms only. -w Wait before termination for an amount of time calculated from the number of characters in the message. This is useful if it is exe- cuted as part of the logout procedure to guarantee that the message can be read before the screen is cleared. The user may specify alternative sayings. You can specify a specific file, a directory which contains one or more files, or the special word all, which says to use all the standard databases. Any of these may be preceded by a percentage, which is a number N between 0 and 100 inclusive, followed by a '%' character. If it is, there will be an N percent probability that an adage will be picked from that file or directory. If the percentages do not sum to 100, and there are specifications without percentages, the remaining percent will apply to those files and/or directories, in which case the probability of selecting from one of them will be based on their relative sizes. As an example, given two databases funny and not-funny, with funny twice as big, saying $ fortune funny not-funny will get you fortunes out of funny two-thirds of the time. The command $ fortune 90% funny 10% not-funny will pick out 90% of its fortunes from funny (the ``10%'' is unnecessary, since 10% is all that's left). The -e option says to consider all files equal; thus $ fortune -e is equivalent to $ fortune 50% funny 50% not-funny Datafiles for fortune are created by the strfile(8) utility, which is not installed by default, The source code for this utility can be found in /usr/src/games/fortune/strfile, if it exists. FILES
/usr/share/games/fortune/* Fortune files. SEE ALSO
regex(3), random(6), rot13(6) BSD
September 9, 2004 BSD
All times are GMT -4. The time now is 07:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy