Remove whitespace after pipe symbol but not inside words
I have a file that looks like this:
Code:
102| #2 X 1/4-INCH| 30188| EA| FTW| A| NOT SERIAL TRACKING| NOT LOT TRACKING| TRUE| #2 X 1/4-INCH
102| #2 X 1/4-INCH| 30188| EA| VPS| A| NOT SERIAL TRACKING| NOT LOT TRACKING| TRUE| #2 X 1/4-INCH
102| #6 X 1/2"| 06484| EA| FTW| A| NOT SERIAL TRACKING| NOT LOT TRACKING| TRUE| #6 X 1/2"
102| #6 X 1/2"| 06484| EA| VPS| A| NOT SERIAL TRACKING| NOT LOT TRACKING| TRUE| #6 X 1/2"
102| #702-750SS12| 51506| EA| FTW| A| NOT SERIAL TRACKING| NOT LOT TRACKING| TRUE| #702-750SS12
102| #702-750SS12| 51506| EA| VPS| A| NOT SERIAL TRACKING| NOT LOT TRACKING| TRUE| #702-750SS12
102| (TIPS) FXKD3151| 1DJ82| EA| FTW| A| NOT SERIAL TRACKING| NOT LOT TRACKING| TRUE| (TIPS) FXKD3151
102| (TIPS) FXKD3151| 1DJ82| EA| VPS| A| NOT SERIAL TRACKING| NOT LOT TRACKING| TRUE| (TIPS) FXKD3151
102| 00-000020| 33ES4| EA| FTW| A| NOT SERIAL TRACKING| LOT TRACKING| TRUE| 00-000020
it will remove all whitespace after the | pipe symbol.
I tried to protect the pipe symbol but this command removed the pipe symbol and all whitespace
Code:
:%s/\| \+//g
What I want is to remove the whitespace only after the pipe symbol. But not the space between the part numbers themselves.
Like this:
Code:
102|#6 X 1/2"|06484|EA|FTW|A|NOT SERIAL TRACKING|NOT LOT TRACKING|TRUE|#6 X 1/2"
102|(TIPS) FXKD3151|1DJ82|EA|FTW|A|NOT SERIAL TRACKING NOT LOT TRACKING|TRUE|(TIPS) FXKD3151
How do I tell VIM to start with the | pipe symbol and remove the space up to the next word but not in the middle of words. I want to keep the space between (TIPS) FXKD3151 the part number for example.
Hi,
I know removing whitespaces I can found so many threads to read how it works and i did it, but my problem isn't solved...
I have in my script a variable $1 which can contains a text like " Channel ".
No I want to check if $1 contains the word Channel, but I don't know how many... (4 Replies)
I combined 2 files using the paste command. It gave me something like this:
123445 ,AABBNN
22344 ,BBVVMM
I want to remove the whitespace between the end of string 1 and the comma (there is more blank space than my post is showing). Would I... (2 Replies)
hi guys i have 6000 rows column
the text in the column has the symbol vertical bar |.
i tried some of the commands to remove it but none of the commands are reconzng this symbol. would u plz help to remove this symbol from the text with any kind of unix command
u r help would be appreciated
... (9 Replies)
Hi Gurus,
I had a problem writing a pipe file.
Previously i used this code to generate a tab seperated file
ABCEF := ABCEF || 'to_char('|| abc_tab(col_num).col_name || ') chr(9) || ';
Now i want the o/p as pipe seperated file.I changed the line as below
ABCEF := ABCEF ||... (0 Replies)
Hi,
I have the following directory:
/home/dragon/websphere/cells/profile/imp/001/
I want to put this in a shell script and get the values before and after cells by removing the '/'
Any idea how to make this possible?
Regards,
Dinesh (6 Replies)
I want to replace the whitespace with Pipe symbol to do a multiple pattern matching for the whole text "mysqld failed start" and same as for other text messages Below are the messages stored in a file seperate by whitespace
mysqld failed start
nfsd mount failed
rpcbind failed to start
for... (6 Replies)
hi, i am copying an xml file from windows to linux server using filezilla&winscp. xml file contains ¦¦ symbols, after copying xml file to server ¦¦ is replaced with <A6><A6>. tried with copying xml files from windows in ascii&binary but no luck.
please suggest.
thanks (1 Reply)
I have file with are delimited by pipe(|) symbol, I wanted those to be removed except the ones which are enclosed in double quotes.
If your quote file is:
|Life is |Beautiful"|"Indeed life |is beautiful too|"|"But unix is fun| is not"|"
It should return:
Life is Beautiful"|"Indeed life is... (1 Reply)
I have file with are delimited by pipe(|) symbol, I wanted those to be removed except the ones which are enclosed in double quotes.
If your quote file is:
|Life is |Beautiful"|"Indeed life |is beautiful too|"|"But unix is fun| is not"|"
It should return:
Life is Beautiful"|"Indeed life is... (9 Replies)
with in my files i have the data like this, starting with a pipe and ending the line with a pipe.
all i want is to replace the first and last pipe , remove those
trying to use following sed command, but it is only showing on the screen the entire data of the file as if it removed, but when i... (4 Replies)