10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
how to Remove comma as last charector in end of last line of file:
example:
input file
---------------
aaaaaa,
bbbbbb,
cccc,
12345,
____________
output file :
-----------
aaaaaa,
bbbbbb, (6 Replies)
Discussion started by: RahulJoshi
6 Replies
2. UNIX for Dummies Questions & Answers
Hi guys,
Does anyone know how to remove the last character in each of the line?
This is what I have:
ABCDE.1
GLSJD.2
HIJPL.2
HKAGB.3
IUBWQ.1
What I want (remove the dot and number):
ABCDE
GLSJD
HIJPL
HKAGB
IUBWQ
I tried to use this: sed 's/.*//'
But I'm not sure if that is... (3 Replies)
Discussion started by: narachaid
3 Replies
3. Shell Programming and Scripting
I have a file with different record length. The file as to be converted into fixed length by appending spaces at the end of record. The length should be calculated based on the record with maximum length in the file.
If the length is less than the max length, the spaces should be appended... (4 Replies)
Discussion started by: Amrutha24
4 Replies
4. Shell Programming and Scripting
Good afternoon:
im working wih 2 files to find differences and use the cmp command
cmp file1 file2
file1 file2 are are diifferent char 302 line1
i found what the difference is with the sed command and that is the file1 at the end of every line has a (,) (comma) character.
i.e
sed -n... (4 Replies)
Discussion started by: alexcol
4 Replies
5. Shell Programming and Scripting
Hi,
I have a file with lines such as the below. I want to remove the comma only if it is the first character on a line. I can't work out how to do this using sed.
*ELSET, ELSET=WHEEL_TD2
63, 64, 65, 72, 82, 88, 89, 92, 120, 121, 152, 181, 190, 221, 252, 259
, 260, 282, 283, 285, 286,... (2 Replies)
Discussion started by: carlr
2 Replies
6. Shell Programming and Scripting
I need to remove new line character from end of file.
Suppose here are content.
a|b|c|d|r
a|b|c|d|r
a|b|c|d|r
<new line>
that means file contains 4 lines but data is there in 3 lines.
so I want that only 3 lines should be there in file.
Please help (20 Replies)
Discussion started by: varun940
20 Replies
7. Shell Programming and Scripting
Hi,
we are trying to process a csv file,in which we are getting data with line breaks.How to remove the line break character in the file?
when i try to print the line break charcter using od -c,it gives as '\n' character for both line break and line feed.
Please provide your valuable... (6 Replies)
Discussion started by: cnraja
6 Replies
8. 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
9. UNIX for Advanced & Expert Users
Hi,
I am facing one interesting problem :
I have a file which contains data like this
459,|1998-11-047|a |b |c \n efg | d|e | \n
459,|1998-11-047|a \n c|b |c \n efg | d|e | \n
Basically what I have to do is , I have to remove all \n which is coming ( enclosed ) in between... (7 Replies)
Discussion started by: shihabvk
7 Replies
10. Shell Programming and Scripting
Hi,
I need to put the single line contents of a file into a variable, but remove the last character, for example the file would have this sort of contents:
2;4;3;10;67;54;96;
And I want the variable to be:
2;4;3;10;67;54;96 (notice the last ";" has gone).
Unfortunately I can't just... (4 Replies)
Discussion started by: danhodges99
4 Replies