10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I would like have a shell script to check every line in a file to see if it ends with ";". If this is NOT the last character ";" should be added.
web9331803;01/01/2014... (14 Replies)
Discussion started by: vg77
2. Shell Programming and Scripting
I have got a small requirement in my script. and i am using bash shell. I need to add a dot (.) for some particular line in a file. Say for example,
1 This is line1
2 This is line2
3 This is line3
O/p should be :
1 This is line1
2 This is line2. #... (2 Replies)
Discussion started by: Sivajee
3. Shell Programming and Scripting
Need to add end of line character to last record in a fixed width file.
When i take the record length of each line, for all the records it gives example like 200 except the last line as 199.
Due to this my other script fails.
Please help me on this. (4 Replies)
Discussion started by: Amrutha24
4. Shell Programming and Scripting
I have a rather unusual problem, which i have not faced till now. I have a script which exports some paths to a text file. The script runs fine but when i check the output file i can see some junk characters ^M appended at end of lines and random places. I am not able to figure... (4 Replies)
Discussion started by: raghu_shekar
5. Shell Programming and Scripting
I used following to add * at the end of the line in file1.
It adds * at the end but has a space before it for some lines but some other lines it adds exactly after the last character.
How do I take out the space ?
sed 's/$/*/' file1 > file2
contents of file1 :
... (2 Replies)
Discussion started by: pitagi
6. Shell Programming and Scripting
i want to append a character '|' at end of each line of a file abc.txt.
for example if the file abc.txt conatins:
i want result file xyz.txt
I know this is simple but sumhow i am not able to reach end of line.
its urgent, thanks for... (4 Replies)
Discussion started by: muaz
7. UNIX for Advanced & Expert Users
Hi, I've got a file where in the middle of the record is a $ end of line character, visible only when I open the file in vi and do :set list. How to I get rid of the character in the middle and keep it at the end. The middle $ character always appears after SW, so that can be used to tag it.... (3 Replies)
Discussion started by: bwrynz1
8. Shell Programming and Scripting
I have file as shown below.
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
9. UNIX for Dummies Questions & Answers
Hi, sorry for being dumb but I have a file with a variable amount of records (day to day it differs) but is fixed at 80 characters wide. Unfortunately the 80th and last charachter in each line is a "^M" carriage return character which i want to get rid of. Is there a really easy command that i can... (6 Replies)
Discussion started by: hcclnoodles
10. Shell Programming and Scripting
How do i determine what the end of the line character is in a text file. for eg. is it \n or \f or \t etc..
Is there a unix command for this? (5 Replies)
Discussion started by: zomboo