10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
Hi,
I have a file that has data something like below:
A
B
C
D
.....
......
.....and so on
I am trying to bring it in one line with comma delimited something like below :
A,B,C,D
I tried the something below in the code section:
cat File.txt | tr '\n' ',' (1 Reply)
Discussion started by: rkumar28
1 Replies
4. UNIX for Dummies Questions & Answers
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
5. UNIX for Dummies Questions & Answers
I need to remove square brackets from output of script.
Output is:
and I need to remove the square brackets so I am lett with
121 Is sed the only means to do this and if so what are the options?
...ok so far I have managed to get rid of ] by using /usr/bin/sed 's/]//' but that... (5 Replies)
Discussion started by: rob171171
5 Replies
6. HP-UX
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
How can I remove the last character from each line of a file?
This must be done without "funny" characters, as I want to transfer the code to/from Windows.
Any ideas? (17 Replies)
Discussion started by: cjhancock
17 Replies
9. UNIX for Dummies Questions & Answers
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
10. Shell Programming and Scripting
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