07-14-2009
Hi
I solved it
nothing wrong with any commands
it's just my MacBook text format problem.
The thing is windows new lines /n and macintosh /r
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
¿How can i remove blank lines between all lines in a long text file?
Example
WrongFile.txt :
Line 1
Line 2
Line 3
CorrectFile.txt :
Line 1
Line 2
Line 3
Thanks in advance
:confused: (4 Replies)
Discussion started by: osymad
4 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
I use translate web to get subtitle file in my langues . But in output file have bad blank lines .
I need scrip (i use debian ) to remove this blank lines .
szintax of my bad *.srt file :
------
number
blank1
number:number ---> number:number
blank2
text1
.
textn
blankS... (10 Replies)
Discussion started by: hungbp
10 Replies
3. UNIX for Advanced & Expert Users
I have a file with the below data, i would like to remove the end blank lines with no data. I used the below commands but could not able to succeed, could you please shed some light.
Commands Used:
sed '/^$/d' input.txt > output.txt
grep -v '^$' input.txt > output.txt
input.txt file... (5 Replies)
Discussion started by: Ariean
5 Replies
4. Shell Programming and Scripting
Hi Guys,
I have been trying to remove blank lines from a file with no success. I tried using all the following options on the file:
tr -s '\n' < abc.txt
grep -v "^$" abc.txt
sed '/^$/d' abc.txt
sed '/./!d' abc.txt
awk '/./' abc.txt
The file is a text file. (11 Replies)
Discussion started by: npatwardhan
11 Replies
5. Shell Programming and Scripting
I really hope someone can help me with this. I have several php files from a forum that I run, that now for some reason have blank lines after every line. Is there an easy way to make a script that does the following:
* If there are consecutive blank lines, delete all of them except one.
* If... (9 Replies)
Discussion started by: KidCactus
9 Replies
6. Shell Programming and Scripting
Hi,
I'm not a expert in shell programming, so i've come here to take help from u gurus.
I'm trying to tailor a csv file that i got to make it work for the LOAD FROM command.
I've a datatable csv of the below format -
--in file format
xx,xx,xx ,xx , , , , ,,xx,
xxxx,, ,, xxx,... (11 Replies)
Discussion started by: dvah
11 Replies
7. Shell Programming and Scripting
Hi,
I am facing a problem related to removing blank lines from a text document.
Input
Error 17-05-2011 11:01:15 VisualSVN Server 2.1 1001
The following information was included with the event:
line3
line4
Error 17-05-2011 11:00:25 VisualSVN Server 2.1 ... (13 Replies)
Discussion started by: mayursingru
13 Replies
8. UNIX and Linux Applications
When I 'vi' my test file I see some blank lines. However once I do :set list to display hidden characters, I see the empty lines literally like this:
^I$
How do I remove them? I cannot find a regex to match them. (3 Replies)
Discussion started by: alexsuv
3 Replies
9. Shell Programming and Scripting
Hi,
Which option is used to remove blank lines in VI (AIX). ?
Regards,
Siva (6 Replies)
Discussion started by: ksgnathan
6 Replies
10. UNIX for Dummies Questions & Answers
plz help me to figure it out
how i remove empty or blank files using cat command.
i will be very thankful if u send me this answer...
thanks (3 Replies)
Discussion started by: mushfiks1
3 Replies
LEARN ABOUT DEBIAN
swiss::textfunc
SWISS::TextFunc(3pm) User Contributed Perl Documentation SWISS::TextFunc(3pm)
NAME
SWISS::TextFunc
DESCRIPTION
This module is designed to be a repository of functions that are repeatedly used during parsing and formatting of SWISS-PROT/TREMBL lines.
If more than two line types need to do aproximately the same thing then it is probably in here.
All functions expect to be called as package->function(param list)
listFromText
Takes a piece of text, a seperator regex and a seperator that may appear at the end. Returns an array of items that were seperated in
the text by that seperator. Takes care of null items (looses them for you).
textFromList
Takes an array of items, a separator, a terminating string, and a line width. Returns an array of strings, each ending with the
separator or the terminator with a width less than or equal to the width specified.
Seems to do the wrong thing for references - not sure why. Don't use it for that.
wrapText
Takes a string and a length. Returns an array of strings which are shorter or equal in length to length, spliting the string on white
space.
wrapOn ($firstLinePrefix, $linePrefix, $colums, $text[, @separators])
Wraps $text into lines with at most $colums colums. Prepends the prefixes to the lines. @separators is a list of expressions on which
to wrap. The expression itself is part of the upper line.
If no @separators are provided, the $text is wrapped at whitespace except in EC/TC numbers or at dashes that separate words.
First tries to wrap on the first item of @separators, then the next etc. If no wrap on any element of @separators or whitespaces is
possible, wraps into lines of exactly length $colums.
A special case is that the first item of @separators may be a reference to an array. This is used internally for wrapping FT VARIANT-
like lines.
Example:
wrapOn('DE ', 'DE ', 40,
'14-3-3 PROTEIN BETA/ALPHA (PROTEIN KINASE C INHIBITOR PROTEIN-1)',
's+')
returns ['14-3-3 PROTEIN BETA/ALPHA (PROTEIN ',
'KINASE C INHIBITOR PROTEIN-1)']
wrapOn('DE ', 'DE ', 40,
'14-3-3 PROTEIN BETA/ALPHA (PROTEIN KINASE C INHIBITOR PROTEIN-1)',
' (?=()', 's+')
returns ['14-3-3 PROTEIN BETA/ALPHA ',
'(PROTEIN KINASE C INHIBITOR PROTEIN-1)']
cleanLine
Remove the leading line Identifier and three blanks and trailing spaces from an SP line.
joinWith ($text, $with, $noAddAfter, @list)
Concatenates $text and @list into one string. Adds $with between the original elements, unless the postfix of the current string is
$noAddAfter. This is used to avoid inserting blanks after hyphens during concatenation. So unpleasant strings like 'CALMODULIN-
DEPENDENT' are avoided. Unfortunately a correct reassembly of strings like 'CARBON-DIOXIDE' is not done.
insertLineGroup ($textRef, $text, $pattern)
Inserts text block $text into the text referred to by $textRef. $text will replace the text block in $textRef matched by $pattern.
uniqueList (@list)
Returns a list in which all duplicates from @list have been removed.
currentSpDate
returns the current date in SWISS-PROT format
toMixedCase($text, @regexps)
Convert a text to mixed case, according to one or more regular expressions. In scalar context, returns the new text; in array context,
also returns the regexp with which the change was performed, or undef on failure. See corresponding item in SWISS::GN for more
details.
perl v5.10.1 2006-08-31 SWISS::TextFunc(3pm)