Sponsored Content
Top Forums Shell Programming and Scripting In vi editor I want to replace next line char by space Post 302454018 by rajamadhavan on Friday 17th of September 2010 04:06:24 AM
Old 09-17-2010
OS is not the issue...
Is the file created on the same system or is downloaded from another system? If later case, you may try 'dos2unix' on the file and then use the above command in vi.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

replace space with new line

i have a file named as templist which looks like this: i want to translate spaces to a new line so that the file would look like this im using sed with this sed -e 's/" "/\n/' templist > templist.out but it doesn't work. can someone please help me. (2 Replies)
Discussion started by: dakid
2 Replies

2. Shell Programming and Scripting

gnu sed replace space with new line

please help in making sed singleline command i need to insert dos new line (CR LF) before " 34 matching device(s) found on \\cpu1." " 6 matching device(s) found on \\cpu7." " 102 matching device(s) found on \\mainserver." the problem is that sometimes there are both CR LF before strings and... (1 Reply)
Discussion started by: xserg
1 Replies

3. Shell Programming and Scripting

how to replace new line ( \n ) with space or Tab in Sed

Hi, how to replace new line with tab in sed ... i used sed -e 's/\n/\t/g' <filename > but its not working (1 Reply)
Discussion started by: mail2sant
1 Replies

4. Shell Programming and Scripting

SED: Place char at starting and replace selected line

Hello Experts, I am working on a small file editing script. Since all experts here are very generous to give me the complete code, I would take up the problem in steps so that I ensure my opportunity to learn. AIM: The script has some commented and some uncommented lines. I need to : ... (2 Replies)
Discussion started by: hkansal
2 Replies

5. UNIX for Advanced & Expert Users

Sed - add text to start of line if 1st char anything but space

Problem: I have a lot of files, the files first line should always have 4 spaces before any text. Occasionally some of the files will miss the leading spaces and it's a problem. This is only in the first line. So if there are 4 spaces then text, do nothing. If there are not 4 spaces, add 4... (2 Replies)
Discussion started by: Vryali
2 Replies

6. Shell Programming and Scripting

sed : replace space and end-of-line

Hi ! I'm rather new with sed ... learned a lot already by googling etc ... The following script should replace all spaces and ends-of-lines with "something (see below). #!/bin/bash i=0 while read line do fam="H`printf "%06d" $i`" echo $line | sed -e 's//\t'$fam'\n/g' i=$(($i+1))... (7 Replies)
Discussion started by: jossojjos
7 Replies

7. Shell Programming and Scripting

Replace end of line with a space

for eg: i have i/p file as: ================ i wnt to change end of line ================= my require ouput is like: i wnt to change end of line ==================== (7 Replies)
Discussion started by: RahulJoshi
7 Replies

8. Shell Programming and Scripting

Match a char with duplicates in a line and replace one of them

Hi, i have a huge file that need to check for a pattern that occur more than once in a line like below:- #lkk>cd-m>A0DV0>192.134.1.1 blablabladsdjsk jshdfskfslfs #lqk>cd-m>A1SV0>192.14.11.1 blalalbnalablab balablablajakjakjakja #pldqw>sf-w>PH67FR>168.55.1.1 balablabala... (5 Replies)
Discussion started by: redse171
5 Replies

9. UNIX for Dummies Questions & Answers

Replace the unexpected newline char with space in a Fixed width file

Input eg: Ouput Expected. The #rd line had the unexpted new line, which need to be replaced with space. I was planing to go with checking the length of each line using awk and if the length is less than the defeined limit, (12 in above case) will replace the newline with space. ... (5 Replies)
Discussion started by: deepakwins
5 Replies

10. UNIX for Advanced & Expert Users

Replace \n char true line Separator

Unix File is pipe delimited with 17 fields. We may get extra pipes in data also. We may get \n char (1 or more \n in one field or multi fileds) in data in any field. Need to replace \n true ( line separator) with 'space and bell char space' chars (' \a ') Not data \n. Input:... (1 Reply)
Discussion started by: rajeshkumare
1 Replies
PMSPECLOCALPMDA(3)					     Library Functions Manual						PMSPECLOCALPMDA(3)

NAME
__pmSpecLocalPMDA - process command-line argument for the table of DSO PMDAs C SYNOPSIS
#include <pcp/pmapi.h> #include <pcp/impl.h> char *__pmSpecLocalPMDA(const char *spec); cc ... -lpcp DESCRIPTION
PCP contexts of type PM_CONTEXT_LOCAL are used by clients that wish to fetch metrics directly from one or more PMDAs on the local host without involving pmcd(1). __pmSpecLocalPMDA provides a convenience wrapper to be used by applications that wish to use a command line argument (usually with -K) to control the DSO PMDAs that are available for a PM_CONTEXT_LOCAL context. The spec argument specifies actions for one or more DSO PMDAs using up to four fields separated by commas (``,''), namely: - an opcode with one of the values add (add a new entry), del (delete an existing entry) or clear (clear all entries from the table). - the PMDA's domain number - the path to the PMDA DSO (may be absolute or relative to the $PCP_VAR_DIR/pmdas directory and the DSO suffix is optional), and - the name of the PMDA's initialization routine. All fields are required to add a new entry. To delete an entry the opcode is required plus either or both of the domain number and path fields. To clear all entries, only the opcode is required. If spec is parsed successfully, then __pmLocalPMDA(3) is called with the extracted arguments. RETURN VALUE
On success, __pmSpecLocalPMDA will return NULL. On error or failure, __pmSpecLocalPMDA will return a pointer to a static error message. EXAMPLES
Some examples of valid spec strings: clear Delete all entries from the DSO table. add,123,foo/foo_pmda,foo_init Add the ``foo'' PMDA using domain 123. The PMDA's DSO is most likely in below the directory $PCP_PMDAS_DIR and named foo/foo_pmda.so (for ELF-style platforms) or foo/foo_pmda.dylib (for BSD-style platforms) or fooo_pmda.dll (for Windows-style plat- forms). The initialization routine for the ``foo'' PMDA is foo_init(). del,123 Delete the entry for the DSO with domain 123. del,,foo/foo_pmda Delete the entry with a pathname to the DSO that matches foo/foo_pmda. del,123,foo/foo_pmda Delete the entry for the DSO with either domain 123 and/or a pathname to the DSO that matches foo/foo_pmda. SEE ALSO
PMAPI(3), __pmLocalPMDA(3) and pmNewContext(3). Performance Co-Pilot PMSPECLOCALPMDA(3)
All times are GMT -4. The time now is 02:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy