Sponsored Content
Top Forums Shell Programming and Scripting Replace trailing whitespaces with pipe symbol using perl Post 302732579 by Don Cragun on Sunday 18th of November 2012 01:21:33 PM
Old 11-18-2012
What you have shown us is still a single line of input and a single line of output with the 3rd and 6th spaces (which do not appear to be trailing spaces) changed to vertical bars. I still don't understand how to translate your example into a meaningful script. Smilie

Please edit your original post and insert appropriate CODE tags so we can see what you're trying to do.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove verticalbar or pipe symbol

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)
Discussion started by: bogu0001
9 Replies

2. Shell Programming and Scripting

Problem while concating PIPE symbol with a file

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)
Discussion started by: pssandeep
0 Replies

3. Shell Programming and Scripting

replace nulls with whitespaces in a file

Hi, i have a file which contains data in fixed length. each row contains data of 10 characters fixed length. The data in the file appears like 4567782882 some times i may recieve dat less than fixed length of 10. in such a case i find nulls appended at the trailing spaces when i do a... (2 Replies)
Discussion started by: meeragiri
2 Replies

4. Shell Programming and Scripting

PERL - Compare 2 strings, excluding whitespaces

I am creating a script to compare definitions and declarations of functions in C code, and report if the arguments are different. So I need to compare the 2 strings (args of both), how can I do that? (2 Replies)
Discussion started by: bojomojo
2 Replies

5. Shell Programming and Scripting

Remove whitespace after pipe symbol but not inside words

I have a file that looks like this: 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"| ... (2 Replies)
Discussion started by: djehresmann
2 Replies

6. Shell Programming and Scripting

Separate letters and replace whitespaces

Input file: aaaa bbb dd. qqq wwww e. Output file: a a a a <s> b b b <s> d d . q q q <s> w w w w <s> e . Can I use sed to do so in one step? (5 Replies)
Discussion started by: Viernes
5 Replies

7. Shell Programming and Scripting

Broken pipe symbol replaced with <A6><A6>

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)
Discussion started by: Satyak
1 Replies

8. Shell Programming and Scripting

Remove pipe(|) symbol ina file, except the ones which are enclosed in double quotes

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)
Discussion started by: Sathyapts
1 Replies

9. Shell Programming and Scripting

Remove pipe(|) symbol in except the ones which are enclosed in double quotes

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)
Discussion started by: Sathyapts
9 Replies

10. Shell Programming and Scripting

How to replace the first and last character which is pipe symbol in all files within a folder?

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)
Discussion started by: cplusplus1
4 Replies
expand(1)						      General Commands Manual							 expand(1)

NAME
expand, unexpand - expand tabs to spaces, and vice versa SYNOPSIS
tablist] [file ...] tablist] [file ...] Obsolescent: tabstop] tabn] [file ...] DESCRIPTION
processes the named files or the standard input and writes to the standard output with tabs changed into spaces. Backspace characters are preserved in the output, and the column count is decreased by one column for tab calculations. For proper tab calculation, if a multi-col- umn character is to be "backspace'd", it should be followed by multiple backspace characters which equal to it's column width. If a tab character is found after the last tab position, it is replaced by a single space. is useful for preprocessing character files that contain tabs (before sorting, looking at specific columns, etc). recognizes the following command-line options and arguments: tablist specifies where to set the tab positions instead of the default tablist can take two forms. If it is a single num- ber, tabs are set tablist spaces apart. tablist can also be a blank- or comma-separated list of increasing positions where tabs are to be set. This option is obsolescent and is equivalent to using This option is obsolescent and is equivalent to using processes the named files or the standard input and writes to the standard output with spaces changed into tabs where possible. By default, only leading spaces and tabs are converted to maximal strings of tabs. The default tab position is every 8 characters. Backspace characters are preserved into the output, and the column count is decreased by one column for tab calculations. For proper tab calcula- tion, if a multi-column character is to be "backspace'd", it should be followed by multiple backspace characters which equal to it's column width. recognizes the following command-line options and arguments: Tabs are inserted whenever they would compress the resultant file by replacing two or more spaces before a tab position. tablist specifies the tab positions. tablist can take two forms. If it is a single number, tabs are set every tablist spa- ces apart. If tablist is a blank- or comma-separated list of increasing positions, tabs are set at those locations. The option implies the option. If the option is not specified, the default is equivalent to specifying except that is not implied for this case. EXTERNAL INFLUENCES
Environment Variables determines the interpretation of text as single and/or multi-byte characters. determines the language in which messages are displayed. If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, and behave as if all internationalization variables are set to "C". See environ(5). If is set to a non-empty string value, it overrides the values of all the other internationalization variables. International Code Set Support Single- and multi-byte character code sets are supported with the exception that do not recognize multi-byte alternative space characters. STANDARDS CONFORMANCE
expand(1)
All times are GMT -4. The time now is 06:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy