Sponsored Content
Top Forums Shell Programming and Scripting Remove ":" and join lines in outline file Post 302473439 by jostber on Saturday 20th of November 2010 04:39:25 AM
Old 11-20-2010
Remove ":" and join lines in outline file

I have a vim outliner file like this:

PHP Code:
Title   
        title 2 
                
:Testing now
                
:testing 2
                
:testing 3
        title 3 
                
:testing
                
:ttt
                
:ttg 
Is there a way to use a script or command to remove the ":" in front of the the text blocks and join these lines to give this output?

PHP Code:
Title   
        title 2 
                Testing now testing 2 testing 3
        title 3 
                testing ttt ttg 
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

join two lines when the second line contains "US DOLLAR"

I want to join two lines together when the second line contains "US DOLLAR". How to do that with sed? Original file: # cat testdata Sep. 24, 2005 Sep. 26, 2005 PHARMA PLUS DRUGMART 1149 $5.85 Sep. 25, 2005 Sep. 27, 2005 99 RESTAURANT #015 $11.00 US DOLLAR @ 1.203636 $13.24 ... (2 Replies)
Discussion started by: powah
2 Replies

2. Shell Programming and Scripting

"Join" or "Merge" more than 2 files into single output based on common key (column)

Hi All, I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations: 1. I am restrained to 2 input files only. 2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

5. UNIX for Dummies Questions & Answers

how to join two files using "Join" command with one common field in this problem?

file1: Toronto:12439755:1076359:July 1, 1867:6 Quebec City:7560592:1542056:July 1, 1867:5 Halifax:938134:55284:July 1, 1867:4 Fredericton:751400:72908:July 1, 1867:3 Winnipeg:1170300:647797:July 15, 1870:7 Victoria:4168123:944735:July 20, 1871:10 Charlottetown:137900:5660:July 1, 1873:2... (2 Replies)
Discussion started by: mindfreak
2 Replies

6. Shell Programming and Scripting

Cant get awk 1liner to remove duplicate lines from Delimited file, get "event not found" error..help

Hi, I am on a Solaris8 machine If someone can help me with adjusting this awk 1 liner (turning it into a real awkscript) to get by this "event not found error" ...or Present Perl solution code that works for Perl5.8 in the csh shell ...that would be great. ****************** ... (3 Replies)
Discussion started by: andy b
3 Replies

7. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

10. Shell Programming and Scripting

Join, merge, fill NULL the void columns of multiples files like sql "LEFT JOIN" by using awk

Hello, This post is already here but want to do this with another way Merge multiples files with multiples duplicates keys by filling "NULL" the void columns for anothers joinning files file1.csv: 1|abc 1|def 2|ghi 2|jkl 3|mno 3|pqr file2.csv: 1|123|jojo 1|NULL|bibi... (2 Replies)
Discussion started by: yjacknewton
2 Replies
MAIN(3) 								 1								   MAIN(3)

main - Dummy formain(3)

	There  is  no  function  named	main(3)  except  in  the  PHP  source.	In  PHP  4.3.0,  a  new  type  of error handling in the PHP source
       (php_error_docref) was introduced. One feature is to provide links to a	manual	page  in  PHP  error  messages	when  the  PHP	directives
       html_errors (on by default) and docref_root (on by default until PHP 4.3.2) are set.

	Sometimes  error messages refer to a manual page for the function main(3) which is why this page exists. If you discover such a reference,
       please file a bug report, indicating the PHP function caused the error that linked to main(3) and it will be fixed and properly documented.

       Known errors that point to main(3)

       +----------------+-----------------------------+
       | Function name	|			      |
       |		|			      |
       |		| No longer points here as of |
       |		|			      |
       +----------------+-----------------------------+
       |  include(3)	|			      |
       |		|			      |
       |		|	     5.1.0	      |
       |		|			      |
       |include_once(3) |			      |
       |		|			      |
       |		|	     5.1.0	      |
       |		|			      |
       |  require(3)	|			      |
       |		|			      |
       |		|	     5.1.0	      |
       |		|			      |
       |require_once(3) |			      |
       |		|			      |
       |		|	     5.1.0	      |
       |		|			      |
       +----------------+-----------------------------+
       html_errors, display_errors.

PHP Documentation Group 														   MAIN(3)
All times are GMT -4. The time now is 07:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy