05-09-2007
sed formatting query2
i wish to remove "#" characters and replace them with a single # character. how to do that?
ex if the file is like
####aasd
##pqr
###pqr
#qwert
output shud be
#aasd
#pqr
#pqr
#qwert
plz hlp
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I've been asking on IRC channels but no one answers me, I need to format my hard drive, normally it's just format c:
but c doesn't exist, how do I format when I have linux mandrake installed. Please reply to this quickly, I'm kinda in a rush :( (1 Reply)
Discussion started by: darryll777
1 Replies
2. Shell Programming and Scripting
hi
i have to modify a number accross a file
for example in the following file
name - abc
age 20
name - def
age 25
name - pqr
age 54
name - xyz
age 32
i want the number against all age to be say 50. like this
name - abc
age 50
name - def (2 Replies)
Discussion started by: gopsman
2 Replies
3. Shell Programming and Scripting
had asked this earlier , but now with some small modification. i wish to remove "#" characters and replace them with a single # character. how to do that? . like # should be appended in all lines
ex if the file is like
####aasd
##pqr
#qwert
poppy
output shud be
#aasd
#pqr
#qwert... (2 Replies)
Discussion started by: gopsman
2 Replies
4. Shell Programming and Scripting
Hi,
I have a (quite large) data file which looks like:
_____________
header part..
more header part..
x1 x2 x3 x4 x5 x6
x7 x8 x9 x10 x11 x12
x13 ...
... x59 x60
y1 y2 y3 y4...
... y100
______________
where x1, x2,...,x60 and y1, y2,...y100 are numbers of 10 digits (so each line... (5 Replies)
Discussion started by: lego
5 Replies
5. Shell Programming and Scripting
I have a file called abc.txt which has following contents.
10.180.8.231=31608
10.180.8.232=29011
10.180.8.233=31606
10.180.8.234=40501
10.180.8.235=32591
10.180.8.236=31605
10.180.8.237=30561
10.180.8.238=14231
How would i find a ip address having maximum number of ram available.
Here... (2 Replies)
Discussion started by: pinga123
2 Replies
6. Shell Programming and Scripting
I am executing the following command:
sort file1.txt | uniq -c | sort -n > file2.txt
The problem is that in file 2, I get leading spaces, Like so:
1 N/A|A8MW11
8 N/A|ufwo1
9 N/A|a8mw11
10 900003|smoketest297688
10 N/A|a9dg4
10 danny|danni
12... (5 Replies)
Discussion started by: ddurden7
5 Replies
7. Shell Programming and Scripting
How to remove any space around a specific charachter from a string using sed.
for exmple :
the string is like following
str1='"name", "roll", "addr","job", "pay",'
I need to remove all the spaces aronnd the commas. (8 Replies)
Discussion started by: mady135
8 Replies
8. Shell Programming and Scripting
I need to format a txt file and convert it in CSV.
Any "future" column is separated by a newline.
FROM:
XS1
1.43294
0.0
XS2
1.21824
0.0
TO:
XS1,XS2 (2 Replies)
Discussion started by: alfreale
2 Replies
9. Shell Programming and Scripting
Hi Guys,
i have report that runs every 10 min and send the report of failed jobs to my mail.
Currently i am using a command like this to send mail.
mailx -t -s "FAILURE JOBS IN HYDRA $temp_date" addressee@domain.com < temp_file5
But i am getting mail in this format ....... (4 Replies)
Discussion started by: gkrish
4 Replies
10. Shell Programming and Scripting
I have a file like this :
! 1 ! 542255 ! 50,140.00 !
! 2 ! 551717 ! 5,805.00 !
! 3 ! 551763 ! 8,130.00 !
! 4 ! 551779 ! 750.00 !
! 5 ! 551810 ! 56,580.00 !
! 6 ! 551816 ! 1,350.00 !
! 7 ! 551876 ! 360.00 !
! 8 ! 551898 ! ... (10 Replies)
Discussion started by: adam1969in
10 Replies