solved - removing last n char in every line


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers solved - removing last n char in every line
# 8  
Old 08-04-2010
thanks all for the help.

Code:
sed "s/.\{${CNT}\}$//" infile #satisfied my requirement.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Modifying/Removing Timestamps from a filename

So given filenames of varying lengths, I was wondering how I would remove or modify appended timestamps of the current date DD-MM-YY. So say: test_DD-MM-YY.txt coolbeans_DD-MM-YY.pdf And what I expect the output to be: test.txt coolbeans.pdf Thanks :) (2 Replies)
Discussion started by: sodaboyz
2 Replies

2. Shell Programming and Scripting

How to separate one line to mutiple line based on one char?

Hi Gurus, I need separate one file which is one huge line to mutiple line. file like abcd # bcd # def # fge # ged I want to get abcd bcd def fge ged Thanks in advance (4 Replies)
Discussion started by: ken6503
4 Replies

3. UNIX for Dummies Questions & Answers

[Solved] Removing an 8 character string

Edit: Figured it out. Close the thread please. Solution: \{8}\] edit by bakunin: no need to close the thread, but i changed the title to SOLVED. Thanks for writing a follow-up. (0 Replies)
Discussion started by: unknownn
0 Replies

4. Programming

C++ Removing = from char*

I have a char* str. Suppose str="medium"; I want to check if str has "=" as first non blank position, if it exists, I want to remove it Currently I am checking using if (optarg == '=') cout << "Found =" << endl; (2 Replies)
Discussion started by: kristinu
2 Replies

5. Shell Programming and Scripting

Formatting File having big single line into 95 Char Per Line

Hi All, I have 4 big files which contains one big line containing formatted character records, I need to format each file in such way that each File will have 95 Characters per line. Last line of each file will have newline character at end. Before:- File Name:- File1.dat 102 121340560... (10 Replies)
Discussion started by: lancesunny
10 Replies

6. UNIX for Dummies Questions & Answers

[solved]removing characters from a mass of file names

I found a closed thread that helped quite a bit. I tried adding the URL, but I can't because I don't have enough points... ? Modifying the syntax to remove ! ~ find . -type f -name '*~\!]*' | while IFS= read -r; do mv -- "$REPLY" "${REPLY//~\!]}"; done These messages are... (2 Replies)
Discussion started by: rabidphilbrick
2 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Help with using tr - Removing white spaces

Hi, I have a file that contains whitespaces with spaces and spaces and tabs on each line and am wanting to remove the whitespaces. My version of sed is one that does not recognize \t etc. The sed and awk one-liners below that I found via Google both does not work. So my next best... (3 Replies)
Discussion started by: newbie_01
3 Replies

8. Shell Programming and Scripting

[Solved] Problem in reading a file line by line till it reaches a white line

So, I want to read line-by-line a text file with unknown number of files.... So: a=1 b=1 while ; do b=`sed -n '$ap' test` a=`expr $a + 1` $here do something with b etc done the problem is that sed does not seem to recognise the $a, even when trying sed -n ' $a p' So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies

9. Shell Programming and Scripting

Removing special char's with sed

Hi, I've a txt file which contains the following kind of listed data 18971 ./aosrp18.r 15340 ./aosrp12.r 22996 ./aosrp08.r 17125 ./aosrp06.r I'm trying to get rid of the ./ in the file and have tried the following with sed but I'm not getting the correct result... I'm not sure what way... (7 Replies)
Discussion started by: Jazmania
7 Replies

10. Shell Programming and Scripting

how first char in odd line and second char in even line

Hi I m having ifconfig -a o/p like sbanlab1:ksh# ifconfig -a | egrep "flags|inet" | awk -F' ' '{print $1,$2}' lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> inet 127.0.0.1 lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> inet 127.0.0.1 bge0:... (1 Reply)
Discussion started by: tarunn.dubeyy
1 Replies
Login or Register to Ask a Question
TM::Axes(3pm)						User Contributed Perl Documentation					     TM::Axes(3pm)

NAME
TM::Axes - Topic Maps, Axes for TM::match* DESCRIPTION
The TM module offers the method "match" (and friends) to query assertions in a TM data structure. While there is a generic search specification, it will be too slow. Instead some axes have been implemented specifically. These are listed below. SEARCH SPECIFICATIONS
Automatically generated from TM (1.54) Code:<empty> returns all assertions Code:anyid return all assertions where a given toplet appears somehow 'anyid' => 'the toplet' Code:aplayer.arole.bplayer.brole.type return all assertions of a given type where a given toplet plays a given role and there exist another given role with another given toplet as player 'bplayer' => 'the player for the brole', 'aplayer' => 'the player toplet for the arole', 'arole' => 'the role toplet (incl subclasses) for the aplayer', 'type' => 'the type of the assertion', 'brole' => 'the other role toplet (incl subclasses)' Code:aplayer.arole.brole.type return all assertions of a given type where a given toplet plays a given role and there exist another given role 'aplayer' => 'the player toplet for the arole', 'arole' => 'the role toplet (incl subclasses) for the aplayer', 'type' => 'the type of the assertion', 'brole' => 'the other role toplet (incl subclasses)' Code:char.irole deprecated: return all assertions which are characteristics for a given toplet 'irole' => 'the toplet for which characteristics are sought', 'char' => '1' Code:char.topic return all assertions which are characteristics for a given toplet 'topic' => 'the toplet for which characteristics are sought', 'char' => '1' Code:char.topic.type return all assertions which are a characteristic of a given type for a given topic 'topic' => 'the toplet for which these characteristics are sought', 'char' => '1', 'type' => 'type of characteristic' Code:char.type return all assertions which are characteristics for some given type 'char' => '1', 'type' => 'the characteristic type' Code:char.type.value return all assertions which are characteristics for some topic of a given value for some given type 'value' => 'the value for which all characteristics are sought', 'char' => '1', 'type' => 'the characteristic type' Code:char.value return all assertions which are characteristics for some topic of a given value 'value' => 'the value for which all characteristics are sought', 'char' => '1' Code:class.type returns all assertions where there are instances of a given toplet 'class' => 'which toplet should be the class', 'type' => 'isa' Code:instance.type returns all assertions where there are classes of a given toplet 'type' => 'isa', 'instance' => 'which toplet should be the instance' Code:iplayer return all assertions where a given toplet is a player 'iplayer' => 'the player toplet' Code:iplayer.irole return all assertions where a given toplet is a player of a given role 'iplayer' => 'the player toplet', 'irole' => 'the role toplet (incl subclasses)' Code:iplayer.irole.type return all assertions of a given type where a given toplet is a player of a given role 'iplayer' => 'the player toplet', 'irole' => 'the role toplet (incl subclasses)', 'type' => 'the type of the assertion' Code:iplayer.type return all assertions of a given type where a given toplet is a player 'iplayer' => 'the player toplet', 'type' => 'the type of the assertion' Code:irole return all assertions where there is a given role 'irole' => 'the role toplet (incl subclasses)' Code:irole.type return all assertions of a given type where there is a given role 'irole' => 'the role toplet (incl subclasses)', 'type' => 'the type of the assertion' Code:lid return one particular assertions with a given ID 'lid' => 'the ID of the assertion' Code:nochar returns all associations (so no names or occurrences) 'nochar' => '1' Code:subclass.type returns all assertions where there are subclasses of a given toplet 'subclass' => 'which toplet should be the superclass', 'type' => 'is-subclass-of' Code:superclass.type returns all assertions where there are superclasses of a given toplet 'superclass' => 'which toplet should be the subclass', 'type' => 'is-subclass-of' Code:type return all assertions with a given type 'type' => 'the type of the assertion' SEE ALSO
TM COPYRIGHT AND LICENSE
Copyright 200[8] by Robert Barta, <drrho@cpan.org> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-06-20 TM::Axes(3pm)