10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
PGW|PGW_CDR_|2017-06-23 141946|2017-07-17 131633|2017-08-21
PGW|PGW_CDR_|2017-06-23 141946|2017-07-17 131633|2017-08-21
PGW|PGW_CDR_|2017-06-23 141946|2017-07-17 131633|2017-08-21
PGW|PGW_CDR_|2017-06-23 141946|2017-07-17 131633|2017-08-21
PGW|PGW_CDR_|2017-06-23 141946|2017-07-17... (6 Replies)
Discussion started by: swathi reddy1
6 Replies
2. Shell Programming and Scripting
I'm trying to delete the blank lines from the file $Sfile. tried the below set of commands. Both are giving the same error (: bad interpreter: No such file or directory)
awk 'NF > 0' $Sfile > $Tfile
cat $Tfile
sed -i '/^$/d' $Sfile
cat $Sfile
Not sure if there's any other problem with... (17 Replies)
Discussion started by: Pandee
17 Replies
3. Shell Programming and Scripting
I have below file. I want to remove space at begining of every line and then after also remove blank line from file.
I use below code for each operation.
sed -e 's/^*//' < check.txt > check1.txt
sed '/^\s*$/d' < check1.txt > check2.txt
above code not remove all the space... (12 Replies)
Discussion started by: Mohin Jain
12 Replies
4. Shell Programming and Scripting
hi I am trying to use SED to replace the line matching a pattern using the command
sed 'pattern c\
new line
' <file1 >file 2
I got two questions
1. how do I insert a blank space at the beginning of new line?
2. how do I use this command to execute multiple command using the -e... (5 Replies)
Discussion started by: piynik
5 Replies
5. Shell Programming and Scripting
Hi,
I was trying to remove the blank from beginning of a line.
when I try:
sed 's/^ +//' filename
it does not work
but when I try
sed 's/^ *//' filename
it works
But I think the first command should have also replaced any line with one or more blanks.
Kindly help me in understanding... (5 Replies)
Discussion started by: babom
5 Replies
6. Shell Programming and Scripting
How can I delete spaces at the begining of all lines of my file ? (2 Replies)
Discussion started by: Sara_84
2 Replies
7. Shell Programming and Scripting
Hello and Happy New Year 2012!
I have this example:
1,2,3 4,5,6 7,8,9
For that, I'm trying to get:
1,2,3
4,5,6
7,8,9
for that, I think this might work but doesnt work so far:
awk '{for(i=1;i=NF;i++);sub(/\//,"",$i);print $i}' myfile (2 Replies)
Discussion started by: Gery
2 Replies
8. Shell Programming and Scripting
Hi
Is it possible to do the following in a single command
/usr/xpg4/bin/sed -e '/rows selected/d' /aemu/CALLAUTO/callauto.txt > /aemu/CALLAUTO/callautonew.txt
/usr/xpg4/bin/sed -e '/^$/d' /aemu/CALLAUTO/callautonew.txt > /aemu/CALLAUTO/callauto_new.txt
exit (1 Reply)
Discussion started by: aemunathan
1 Replies
9. Shell Programming and Scripting
Hi All,
below is my data file
file.txt
$$0 ServerA LAN1 AAA IT01 04/30/2008 09:16:26
$$0 ServerB LAN1 AAA IT02 04/30/2008 09:16:26
here $ is a blank space
how to delete first 2 blank spaces in a file. (4 Replies)
Discussion started by: karthikn7974
4 Replies
10. Shell Programming and Scripting
Hi,
I am trying to do two things in my script. I will really appreciate any help in this regards.
Is there a way to delete a last line from a pipe delimited flat file if the last line is blank. If the line is not blank then do nothing.....
Is there a way to count a word that are starting... (4 Replies)
Discussion started by: rkumar28
4 Replies