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
SDFAPI(1)						User Contributed Perl Documentation						 SDFAPI(1)

NAME
sdfapi - API Extraction Utility PURPOSE
sdfapi extracts Application Programming Interface information from (Perl) source code. USAGE
usage : sdfapi [-h[help]] [-o[out_ext]] [-l[log_ext]] [-O[out_dir]] [-f fmt_tag] [-p[pattern]] [-s sym_type,..] [-j] file ... purpose: extract the API from a (perl) library version: 2.000 (SDF 2.001) The options are: Option Description -h display help on options -o output file extension -l log file extension -O output to input file's (or explicit) directory -f output format tag -p only symbols matching pattern -s only symbols of these types -j add SDF-style hypertext jumps from each symbol DESCRIPTION
The -h option provides help. If it is specified without a parameter, a brief description of each option is displayed. To display the attributes for an option, specify the option letter as a parameter. By default, generated output goes to standard output. To direct output to a file per input file, use the -o option to specify an extension for output files. If the -o option is specified without a parameter, an extension of out is assumed. Likewise, error messages go to standard error by default. Use the -l option to create a log file per input file. If the -l option is specified without a parameter, an extension of log is assumed. By default, generated output and log files are created in the current directory. Use the -O option to specify an explicit output directory. If the -O option is specified without a parameter, the input file's directory is used. The format of the output can be controlled using the -f option. Supported formats are std and concise. The default is std. std format is: require "abc.pl"; $myvar = ... $result = &myfunc($myparams); concise format has fewer blank lines and uses 1 line per symbol. A comma-separated list of symbol types to output can be specified using the -s option. Supported symbol types are: o sub - subroutines o var - variables The default is to extract all symbols. The -p option is used to extract only a subset of the symbols. If not supplied, the pattern is symbols beginning with a letter. If supplied without an option, the pattern defaults to all symbols. If perl libraries use the coding convention that symbols beginning with underscore are private, then -p_ can be used to extract the private symbols. The -j option can be used to request SDF-style hypertext jumps be added for each symbol. The jump target is lib_sym where: o lib is the library name o sym is the symbol name. LIMITATIONS AND FUTURE DIRECTIONS
The only language currently supported is Perl. It would be useful to extract messages from the scripts too. This would require a new utility called sdfmsg say, which searched through the source (including libraries) for AppMsg and AppExit calls. Internally, it may be better to implement formats via routines. This would give better control over output. e.g. it would be up to the routine to decide if it wanted to output the 'require' header. perl v5.12.4 2011-11-09 SDFAPI(1)
All times are GMT -4. The time now is 08:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy