ID,Client ,SNo,Rank
37,Airtel
Private
limited,100,999
38,Vodaphone India
Private Limited,200,888
39,Dell Limited,300,777
40,HP India Ltd
,400,666
41,Orange
India
Private
Limited,500,555
In the last row , there are more new lines.
There are new line characters in between the lines, and so when i view the data in test pad i can see the new line characters in between, but actually it shoud be at only endof the line. (This is occuring like this, because in source data is entering in xl doc and there are multiple Alt + Enters in particular fields)
Output should be
Code:
ID,Client ,SNo,Rank
37,Airtel Private limited,100,999
38,Vodaphone India Private Limited,200,888
39,Dell Limited,300,777
40,HP India Ltd,400,666
41,Orange India Private Limited,500,555
Here requirement is to delete the new line characters which occur in between the every 3 commas.
Like select first 3 commas and delete the new line characters in between and then again select the next 3 commans and delete if any new line in between (Don't delete new line which is coming after 3 commas) .....like this delete till the end of the file.
Pl provide me the solution for this
Regards
Kari
Last edited by Scott; 10-28-2010 at 01:06 PM..
Reason: Please use code tags
Hey - my first post here, and I'm a total SED newb. I've looked around for previous help on this, but have so far been unsuccessful.
I have a program (AMStracker for OS X) that outputs data in the terminal. Output is in this form:
.
.
.
3 0 -75
3 0 -76
3 0 -77
... (4 Replies)
Hi,
i want to append a character '|' at end of each line of a file abc.txt.
for example if the file abc.txt conatins:
a|b|c
1|2|33
w|2|11
i want result file xyz.txt
a|b|c|
1|2|33|
w|2|11|
I know this is simple but sumhow i am not able to reach end of line.
its urgent, thanks for... (4 Replies)
Hi Guys,
I have a file like this:
aaa b c d e f
fsss g h i k l
qqq r t h n
I want:
aaa b c d e f
fsss g h i k l
qqq r t h , n
ggg p t e d u
qqq i o s , k (2 Replies)
Hi,
we are trying to process a csv file,in which we are getting data with line breaks.How to remove the line break character in the file?
when i try to print the line break charcter using od -c,it gives as '\n' character for both line break and line feed.
Please provide your valuable... (6 Replies)
I need to remove new line character from end of file.
Suppose here are content.
a|b|c|d|r
a|b|c|d|r
a|b|c|d|r
<new line>
that means file contains 4 lines but data is there in 3 lines.
so I want that only 3 lines should be there in file.
Please help (20 Replies)
Good afternoon:
im working wih 2 files to find differences and use the cmp command
cmp file1 file2
file1 file2 are are diifferent char 302 line1
i found what the difference is with the sed command and that is the file1 at the end of every line has a (,) (comma) character.
i.e
sed -n... (4 Replies)
I have a file with different record length. The file as to be converted into fixed length by appending spaces at the end of record. The length should be calculated based on the record with maximum length in the file.
If the length is less than the max length, the spaces should be appended... (4 Replies)
how to Remove comma as last charector in end of last line of file:
example:
input file
---------------
aaaaaa,
bbbbbb,
cccc,
12345,
____________
output file :
-----------
aaaaaa,
bbbbbb, (6 Replies)
Hi All,
Could any one suggest how to remove $ symbol in a text file when i am opening in vi editor.
Scenario;
For example iam having a file name aaa.txt the data inside the file is like
sample
name
when i am opening in vi editor
The same file resembles like below when i am... (1 Reply)
I have a huge file which contains multiple lines. It need to check whether character length is not more than 255 each line. If its not then it should remove the
character up to column. I have described in the output below. If its more than that
the next line should start with call but if the... (1 Reply)
Discussion started by: JoshvaPeter
1 Replies
LEARN ABOUT DEBIAN
class::virtually::abstract
Class::Virtually::Abstract(3pm) User Contributed Perl Documentation Class::Virtually::Abstract(3pm)NAME
Class::Virtually::Abstract - Compile-time enforcement of Class::Virtual
SYNOPSIS
package My::Virtual::Idaho;
use base qw(Class::Virtually::Abstract);
__PACKAGE__->virtual_methods(qw(new foo bar this that));
package My::Private::Idaho;
use base qw(My::Virtual::Idaho);
sub new { ... }
sub foo { ... }
sub bar { ... }
sub this { ... }
# oops, forgot to implement that()!! Whatever will happen?!
# Meanwhile, in another piece of code!
# KA-BLAM! My::Private::Idaho fails to compile because it didn't
# fully implement My::Virtual::Idaho.
use My::Private::Idaho;
DESCRIPTION
This subclass of Class::Virtual provides compile-time enforcement. That means subclasses of your virtual class are required to implement
all virtual methods or else it will not compile.
BUGS and CAVEATS
Because this relies on import() it is important that your classes are used instead of required. This is a problem, and I'm trying to
figure a way around it.
Also, if a subclass defines its own import() routine (I've done it) Class::Virtually::Abstract's compile-time checking is defeated.
Got to think of a better way to do this besides import().
AUTHOR
Original idea and code from Ben Tilly's AbstractClass http://www.perlmonks.org/index.pl?node_id=44300&lastnode_id=45341
Embraced and Extended by Michael G Schwern <schwern@pobox.com>
SEE ALSO
Class::Virtual
perl v5.10.1 2007-10-23 Class::Virtually::Abstract(3pm)