Sponsored Content
Top Forums UNIX for Dummies Questions & Answers delete newline character between html tags Post 302170970 by scott1256ca on Wednesday 27th of February 2008 07:58:03 AM
Old 02-27-2008
The following assumes you want a new line after each
>
character, otherwise keep printing on the same line until you have one.

I'm calling it tst.pl
===================
#!/usr/bin/env perl
while (<>) {
chomp;
if ( /.*\>$/ ) {
print "$_\n";
} else {
print "$_";
}
}
====================

in file
tst.txt
=================
as;dkl>
asjkf
qoweiu
askldfj>
asdf>
asdf> s
askld
>
=================
produces

as;dkl>
asjkfqoweiuaskldfj>
asdf>
asdf> saskld>


Flavour according to taste.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How can I replace newline character?

Hi, I am trying to write a script to prepare some text for use as web content. What is happening is that all the newlines in the textfile are ignored, so I want to be able to replace/add a few characters so that for a file containg: This is line 1. This is line two. This is line four.... (1 Reply)
Discussion started by: ghoti
1 Replies

2. UNIX for Dummies Questions & Answers

newline character

hi, I want to print the below lines "Message from bac logistics The Confirmation File has not been received." When i give like this in the code "Message from bac logistics\n The Confirmation File has not been received." It is giving only Message from bac logistics\n The... (9 Replies)
Discussion started by: trichyselva
9 Replies

3. UNIX for Dummies Questions & Answers

echo without newline character

hi, I have a for loop where in I write some file name to another file. I want to write all the filenames to another without any newlines. how can i avoid getting new lines with echo? Thanks, Srilaxmi (2 Replies)
Discussion started by: srilaxmi
2 Replies

4. UNIX for Dummies Questions & Answers

Delete the line started with nondigit or newline character

i want to delete the line which is not started with numeric in vim. vim temp.txt Volume in drive D is DATA Volume Serial Number is 8C52-2055 Directory of D:\data\notes 02/16/2010 03:09 PM <DIR> . 02/16/2010 03:09 PM <DIR> .. 09/11/1999 03:03 AM ... (5 Replies)
Discussion started by: Manabhanjan
5 Replies

5. Shell Programming and Scripting

Why SED can't see the last newline character?

Removed. My question does not make sense. and SED does see the last newline character. But I still have a question: How to remove the last newline character(the newline character at the end of last line) using SED? ---------- Post updated 05-01-11 at 10:51 AM ---------- Previous update was... (7 Replies)
Discussion started by: kevintse
7 Replies

6. UNIX for Dummies Questions & Answers

newline character in a variable

variable="unix\nlinux" echo $variable expected output: unix linux :wall: can i do that ?? thanks in advance!! (3 Replies)
Discussion started by: sathish92
3 Replies

7. Shell Programming and Scripting

replacing by newline character

I have a file (pema)with a single long record which i have to break up into multiple lines Input s1aaaaaaaaaaaaaaaaaaaaaaas1bbbbbbbbbbs1cccccccccc Output s1aaaaaaaaaaaaaaaaaaaaaaa s1bbbbbbbbbb s1cccccccccc m planning to do it by replacing s1 by \ns1 \n is the new line character i... (5 Replies)
Discussion started by: pema.yozer
5 Replies

8. UNIX for Dummies Questions & Answers

How to add newline before and after a special character?

So I have a file that contains >NM_#########AUGCAUCGUAGCUAGUCGAUACUGGACUG>NM_########AUGAGUAUGUAUGAUGUAUGUAUGA where # is any digit 0-9 (the text is many repetitions of the pattern above, not just that, but all in one line), and I want it to show >NM_#########... (2 Replies)
Discussion started by: ShiGua
2 Replies

9. Shell Programming and Scripting

Remove last newline character..

Hi all.. I have a text file which looks like below: abcd efgh ijkl (blank space) I need to remove only the last (blank space) from the file. When I try wc -l the file name,the number of lines coming is 3 only, however blank space is there in the file. I have tried options like... (14 Replies)
Discussion started by: Sathya83aa
14 Replies

10. Shell Programming and Scripting

How to remove newline character if it is the only character in the entire file.?

I have a file which comes every day and the file data look's as below. Vi abc.txt a|b|c|d\n a|g|h|j\n Some times we receive the file with only a new line character in the file like vi abc.txt \n (8 Replies)
Discussion started by: rak Kundra
8 Replies
HIME-SETUP(1)						    hime input method platform						     HIME-SETUP(1)

NAME
hime-setup - configuration tools of hime SYNOPSIS
hime-setup DESCRIPTION
hime-setup is the default configuration tool of hime. Another configuring method is writing conffiles in $HOME/.config/hime/config. See CONFFILES section for further information. CONFFILES
Those conffiles below will be created automatically by hime-setup, except hime-bell-volume and hime-sound-play-overlap. If you want to write conffiles by yourself, please make sure you have the config directory: mkdir -p $HOME/.config/hime/config After that, you may try: echo zo > $HOME/.config/hime/config/phonetic-keyboard Thus you make a phonetic-keyboard file with its content zo, which means you select the standard style with 1234 selection method. All available conffiles are listed, and default options are showed bold. $HOME/.config/hime/config/default-input-method number Default input method when hime is called. OPTIONS MEANINGS 1 Chanjei input method, version 3 2 Chanjei input method, version 5 3 Bopomofo input method 4 Symbols virtual keyboard 5 Pinyin input method 6 Tsin intelligent Bopomofo input method 7 Dayi input method 8 Array input method, 30 keys version 9 Boshiamy input method, aka Liu's input method 10 Direct input for UTF-32 (U+) or Big-5 characters 11 Simple Chanjei input method 12 Japanese anthy input method 13 Greek letters input method 14 Latin letters input method 15 Jyutping input method $HOME/.config/hime/config/hime-bell-volume number Volume of bell ring, between -100 to 100. Default is -97. $HOME/.config/hime/config/hime-capslock-lower boolean Input lower-case letters when Caps Lock key is ON. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/hime-eng-phrase-enabled boolean Enable Alt-Shift phrases in alphabet-numeric mode. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/hime-font-name string Default font. OPTIONS MEANINGS sans Sans-serif serif Serif $HOME/.config/hime/config/hime-font-size number Font size of character-selection area. Default is 16. $HOME/.config/hime/config/hime-font-size-gtab-in number Font size of key codes input area in gtab input methods (Chanjei IM, Array IM, etc.). Default is 10. $HOME/.config/hime/config/hime-font-size-pho-near number Font size of similar-phonetic character selection in Tsin IM. Default is 14. $HOME/.config/hime/config/hime-font-size-symbol number Font size of symbol-selection window. Default is 12. $HOME/.config/hime/config/hime-font-size-tsin-pho-in number Font size of phonetic input area in Bopomofo and Tsin IM. Default is 10. $HOME/.config/hime/config/hime-font-size-tsin-presel number Font size of phrase pre-selection window in Tsin IM. Default is 16. $HOME/.config/hime/config/hime-im-toggle-keys number Toggle Key for IM window ON/OFF. OPTIONS MEANINGS 0 Control-Space 1 Shift-Space 2 Alt-Space 3 Windows-Space $HOME/.config/hime/config/hime-init-im-enabled boolean Enable input method mode without pressing toggle keys. This option is not available in XIM mode. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/hime-inner-frame boolean Show frame border in hime window. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/hime-input-style number Window style of hime. OPTIONS MEANINGS 1 OverTheSpot (Follow the cursor) 2 Root (Fixed index window) $HOME/.config/hime/config/hime-pop-up-win boolean Dynamic pop up window. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/hime-remote-client boolean Use hime in remote applications. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/hime-root-x number Window position in X-axis when window style is Root (Fixed index window). Default is 1600. $HOME/.config/hime/config/hime-root-y number Window position in Y-axis when window style is Root (Fixed index window). Default is 1200. $HOME/.config/hime/config/hime-sel-key-color hex Color of selection Key. OPTIONS MEANINGS #FF0000 Red #00FF00 Green #0000FF Blue #FFFF00 Yellow #FF00FF Magenta #00FFFF Cyan $HOME/.config/hime/config/hime-shift-space-eng-full boolean Toggle to double-wide English character mode with Shift-Space. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/hime-sound-play-overlap boolean Play all sound when text-to-speech is enabled. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/hime-status-tray boolean Show hime status in system tray. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/hime-win-color-bg hex Background color of hime window. Default is #005BFF. $HOME/.config/hime/config/hime-win-color-fg hex Foreground color of hime window. OPTIONS MEANINGS #FF0000 Red #00FF00 Green #0000FF Blue #FFFF00 Yellow #FF00FF Magenta #FFFFFF White $HOME/.config/hime/config/hime-win-color-use boolean Customized colors in hime window. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/hime-win-sym-click-close boolean Close symbol-selection window after choosing a symbol. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-auto-select-by_phrase number Auto-select according to Tsin phrase database in gtab input methods. OPTIONS MEANINGS 0 Auto-selected by definition in .gtab file. 1 ON 2 OFF $HOME/.config/hime/config/gtab-disp-im-name boolean Display input method name in gtab input methods. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-disp-key-codes boolean Show all possible key codes of character in gtab input methods. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-disp-partial-match number Display partial matched characters in gtab input methods. OPTIONS MEANINGS 0 Auto-selected by definition in .gtab file. 1 ON 2 OFF $HOME/.config/hime/config/gtab-dup-select-bell boolean Bell ring when multiple selections are available in gtab input methods. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-hide-row2 boolean Hide second row of window in gtab input methods. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-in-row1 boolean Show key codes in first row of window in gtab input methods. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-invalid-key-in boolean Clear key codes input area when invalid key and Space key are pressed. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-pho-query boolean Use ` to query same pronunciation characters. For gtab input methods. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-phrase-pre-select boolean Show candidate phrases before pressing endkey (Space key). For gtab input methods. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-pre-select number Show candidate characters before pressing endkey (Space key). For gtab input methods. OPTIONS MEANINGS 0 Auto-selected by definition in .gtab file. 1 ON 2 OFF $HOME/.config/hime/config/gtab-press-full-auto-send number Auto-send character when key codes input area is filled in gtab input methods. OPTIONS MEANINGS 0 Auto-selected by definition in .gtab file. 1 ON 2 OFF $HOME/.config/hime/config/gtab-que-wild-card boolean Use ? as wildcard. For gtab input methods. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-que-wild-card-asterisk boolean Use * as wildcard. For gtab input methods. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-shift-phrase-key boolean Use single Shift key to input Alt-Shift phrases in gtab input methods. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/gtab-space-auto-first number Function of Space Key in gtab input methods. OPTIONS MEANINGS 0 Auto-selected by definition in .gtab file. 1 Send first character in Boshiamy input method. 2 Send first character in character-selection area. 4 Does not send first character. (For Array input method.) $HOME/.config/hime/config/gtab-unique-auto-send number Auto send characters when there is only one choice in gtab input methods. OPTIONS MEANINGS 0 Auto-selected by definition in .gtab file. 1 ON 2 OFF $HOME/.config/hime/config/gtab-vertical-select number Vertical selection window in gtab input methods. OPTIONS MEANINGS 0 Auto-selected by definition in .gtab file. 1 ON 2 OFF $HOME/.config/hime/config/pho-hide-row2 boolean Hide second row of window in Bopomofo and Tsin IM. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/pho-in-row1 boolean Show key codes in first row of window in Bopomofo IM. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/phonetic-char-dynamic-sequence boolean Dynamic character sequence adjustment in Bopomofo and Tsin IM. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/phonetic-huge-tab boolean Input all Traditional Chinese, Simplified Chinese, and Japanese characters provided by pho-huge.tab in Bopomofo and Tsin IM. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/phonetic-keyboard string Key codes arrangement style in Bopomofo, Tsin, and Japanese anthy IM. OPTIONS MEANINGS zo Standard style with 1234 selection method zo-asdf Standard style with asdf selection method et Eten style with 1234 selection method et-asdf Eten style with asdf selection method et26 Eten 26 keys style with 1234 selection method et26-asdf Eten 26 keys style with asdf selection method hsu Mr. Hsu's style (Kuo-Yin IM, Natural Bopomofo IM) pinyin Phonetic Pinyin style with 1234 selection method pinyin-asdf Phonetic Pinyin style with asdf selection method dvorak Dvorak style ibm IBM style mitac Mitac style $HOME/.config/hime/config/phonetic-speak boolean Enable text-to-speech. You have to install speech data for this feature. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/phonetic-speak-sel string Speech data filename for text-to-speech. $HOME/.config/hime/config/tsin-buffer-editing-mode boolean VI-like editing mode in Tsin IM. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/tsin-buffer-size number Size of buffer (editing area) in Tsin IM. Default is 40. $HOME/.config/hime/config/tsin-chinese-english-toggle_key number Toggle key for Chinese/English mode in Tsin IM. OPTIONS MEANINGS 1 Caps Lock key 2 Tab key 4 Shift key (Not available in XIM mode). 8 Left Shift key (Not available in XIM mode). 16 Right Shift key (Not available in XIM mode). $HOME/.config/hime/config/tsin-cursor-color hex Color of cursor in Tsin IM. OPTIONS MEANINGS #FF0000 Red #00FF00 Green #0000FF Blue #FFFF00 Yellow #FF00FF Magenta #00FFFF Cyan $HOME/.config/hime/config/tsin-phrase-line-color hex Color of phrase-underline in Tsin IM. Default is #0000FF. $HOME/.config/hime/config/tsin-phrase-pre-select boolean Show phrase pre-selection window in Tsin IM. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/tsin-space-opt number Function of Space key in Tsin IM. OPTIONS MEANINGS 1 Select other same phonetic characters. 2 Send space to buffer of Tsin IM. $HOME/.config/hime/config/tsin-tab-phrase-end boolean Use Escape key or Tab key to stop phrase-auto-selection in Tsin IM. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/tsin-tail-select-key boolean Show selection keys follows choices in Tsin IM. OPTIONS MEANINGS 1 ON 0 OFF $HOME/.config/hime/config/tsin-tone-char-input boolean Input tone sympols of Bopomofo in Tsin IM. OPTIONS MEANINGS 1 ON 0 OFF SEE ALSO
hime(1) HIME 0.8 2 FEB 2009 HIME-SETUP(1)
All times are GMT -4. The time now is 08:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy