10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
OS : RHEL 6.7
Shell : bash
I am trying to remove the leading the spaces in the below file
$ cat pattern2.txt
hello1
hello2
hello3
hello4
Expected output is shown below.
$ cat pattern2.txt
hello1
hello2
hello3
hello4 (2 Replies)
Discussion started by: John K
2 Replies
2. UNIX for Dummies Questions & Answers
Dear Masters,
I want to remove all lines with blank spaces
input file:
a|abc|0|1
a|abc|2|3
b||3|5
c|def||7
d|def|0|1
Expected:
a|abc|0|1
a|abc|2|3
d|def|0|1
I did this
awk -F'|' '!/^$/' input (4 Replies)
Discussion started by: radius
4 Replies
3. Shell Programming and Scripting
Hi All,
The output file contains data as below.
"20141023","CUSTOMER" ,"COMPANY" ,"IN0515461" ,"" ,"JOSHUA"
There are spaces in between the ending " and ,. The number of spaces is random.
How can I remove that from the file so that the final output is:... (4 Replies)
Discussion started by: aarsh.dave
4 Replies
4. Shell Programming and Scripting
Hi, suppose I have the following data:
albert music=top40 age=20
bob music=punk rock age=25
candy music=r n b age=22
dave music=mozart or bach only age=30
I want to extract and manipulate the music column but it's got spaces in it. How can I substitute the space with an underscore... (2 Replies)
Discussion started by: almonds
2 Replies
5. Shell Programming and Scripting
Hi folks,
I need to remove spaces at the end of each line in a *.txt file. it looks like this
word 1
word 2
.
.
.
word n
i found some sed commands but any of them didnt work so far
thank you for your posts (6 Replies)
Discussion started by: Jimmy7
6 Replies
6. Shell Programming and Scripting
Hi,
I have files like below, In files coming as spaces. Before transfering those files into ftp server. I want to remove the spaces and then can transfer the files into unix server.
e.g: filenames are
1) SHmail _profile001_20120908.txt
2) SHmail_profile001 _20120908.txt
3) sh... (3 Replies)
Discussion started by: kirankumar
3 Replies
7. Shell Programming and Scripting
Hi All,
I have a comma seperated file.
I wanna remove the spaces from column 2. I mean i don't wanna remove the spaces those are presnt in column 1.
ex:
emp name, emp no, salary
abc k, abc 11, 1000 00
bhk s, bhk 22, 2000 00
the output should be:
emp name, emp no, salary
abc k, abc11,... (4 Replies)
Discussion started by: javeed7
4 Replies
8. Shell Programming and Scripting
Hi All,
I need to modify a script to remove spaces from a csv file.
The csv file is delimited by the '~' character and I need to remove the spaces which appear before this character.
i.e
Sample input:
LQ001 SWAT 11767727 ~9104 ~001 ~NIRSWA TEST 18 ~2 ~Standard Test ~0011
Desired... (5 Replies)
Discussion started by: SRyan84
5 Replies
9. UNIX for Dummies Questions & Answers
filename contains:
123 4
1234 5
12345 689
i want result:
1234
12345
12345679
cat filename | awk '{print $1, $2, $3}' will get my result, but too many $$s.
sed -e 's///g' filename will take care one space, will take 2 spaces.
is it a short way to do this ? (7 Replies)
Discussion started by: tjmannonline
7 Replies
10. Shell Programming and Scripting
I have a file with only one field something like this :
213.45
220.65
240.47
345.67
320.45
I want to remove all spaces in between. Is there any unix command for that ?Thanks in advance.. (2 Replies)
Discussion started by: jacks
2 Replies