removing space


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting removing space
# 1  
Old 06-26-2008
removing space

US76132M1027|NASDAQ Capital Market|NASDAQ Capital

Hi I want to remove the leading space ,i have a file full of lines with this space pls help me
# 2  
Old 06-26-2008
I cannot tell from your sample, but this removes a leading space on each line of a file
Code:
sed '/^ //' file > newfile

# 3  
Old 06-27-2008
remove spaces

Hi
It is throwing an error Unrecognized command: /^ //.
Otherwise is there any option in ISQL to control the output formatting.

I am getting lines with leading spaces as a result od my ISQL query
# 4  
Old 06-27-2008
use this:

sed 's/^ //g' <inputfile >outputfile

or

sed '/^ /d' <inputfile >outputfile
# 5  
Old 06-27-2008
Hi
I tried this time i had no errors but not worked as well.
Please help me out
# 6  
Old 06-30-2008
Try this:
Code:
sed -e 's/^[ \t]*//' inputfile

If it does not work, please let us know your system configuration
uname -a
or dump out the man page for sed
# 7  
Old 06-30-2008
Quote:
Originally Posted by surenz298
Otherwise is there any option in ISQL to control the output formatting.

I am getting lines with leading spaces as a result od my ISQL query

doing it in SQL: use the trim() function or equivalent, if there is. also look for rtrim(), ltrim() etc
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Removing pipe and space in a file

Hi , I have a file which is like below. The file record is separated by | as delimiter. I want to remove the first and last | in the file and also I want to remove the spaces in the columns. Original File |3464114 |10 | REPORT|CA| 1|0|4825400|0|213167| 939396524| Expected:... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies

2. Shell Programming and Scripting

Fixed with file- removing leading zeros and adding the space

Hi All, i have a fixed width file , where each line is 3200 length. File: 1ABC 1111 2222 3333 000012341 1001 2ABC 1111 2222 3333 000012342 1002 3ABC 1111 2222 3333 000112343 1003 1DEF 5555 4444 9696 000012344 1004 2DEF 5555 2323 8686 000012345 1005 3DEF 5555 1212 7676 000012346 1006 ... (1 Reply)
Discussion started by: mechvijays
1 Replies

3. Shell Programming and Scripting

Removing blank space using VI

Hi, How to remove blank spaces using vi (I am using AIX)? #cat siva.txt AAA BBB CCC DDD EEE FFF Need to remove space between 2 columns. Regards, Siva (7 Replies)
Discussion started by: ksgnathan
7 Replies

4. Shell Programming and Scripting

Removing white space in awk

Hi How to remove white space from this input:|blue | 1| |green| 4| |black| 2| I like to search for green and get 4not 4 How to modify this to work correct:awk -F"|" '/green/ {print $3} (7 Replies)
Discussion started by: Jotne
7 Replies

5. Shell Programming and Scripting

Removing blank space in file

TT0000013101257 | JCJMMUJMMUB018 ... (0 Replies)
Discussion started by: sususa
0 Replies

6. Shell Programming and Scripting

removing a space

Hi I want to remove a space for column 6. basically column 6 in my file looks like this: tig 2 tig 9 tig 39 tig 300 I want the output to look like this: tig2 tig9 tig39 tig300 How do I remove that space just for column 6. thanks (5 Replies)
Discussion started by: phil_heath
5 Replies

7. Shell Programming and Scripting

Removing blank lines from comma seperated and space seperated file.

Hi, I want to remove empty/blank lines from comma seperated and space seperated files Thanks all for help (11 Replies)
Discussion started by: pinnacle
11 Replies

8. AIX

Removing page space

I having problem removing a page space.... 1. When I list the page spaces available in the system, I am getting the following messages 0516-310 : Unable to find attribute state in the Device Configuration Database. Execute synclvodm to attempt to correct the database.... (4 Replies)
Discussion started by: srnkumar
4 Replies

9. Shell Programming and Scripting

Removing Space at the end of file

Hi.... I have a situation...I have a data file...that has space(an extra row with no data) at the end of file. I am trying to remove that spaces only if the file has a space at the end of file and if there is no space I don't want to do anything. Can you please help me in this regards. ... (4 Replies)
Discussion started by: rkumar28
4 Replies

10. Shell Programming and Scripting

re: removing trailing space from lines

Not sure why this thread was closed without any explanation, but you can do what you're asking with sed 's/]*$//g' < sourceFile > destFile (1 Reply)
Discussion started by: oombera
1 Replies
Login or Register to Ask a Question