Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Removing last ten characters from a column Post 302300228 by e3r1ck_ETT on Monday 23rd of March 2009 02:38:08 PM
Old 03-23-2009
Removing last ten characters from a column

I have a file that looks like this:

hsa-miR-517b-4373244 0 4.116
hsa-miR-886-5p-4395304 1.173 1.95
hsa-miR-551b-4380945 1.62 1.722
hsa-miR-886-3p-4395305 1.479 3.074
hsa-miR-125a-3p-4395310 1.246 2.697
hsa-miR-874-4395379 1.985 1.721

I want it too look like this:

hsa-miR-517b 0 4.116
hsa-miR-886-5p 1.173 1.95
hsa-miR-551b 1.62 1.722
hsa-miR-886-3p 1.479 3.074
hsa-miR-125a-3p 1.246 2.697
hsa-miR-874 1.985 1.721

...etc.

Any suggestions using unix and / or perl commands?
~much appreciated in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with removing characters like ^M

I have few files in unix which are in dos format. While I am copying these files, ^M, ^@, etc characters are being generated. I tried dos2unix command in Linux and it doesn't work. I tried sed to remove these characters but they won't go. I came to about this 'tr' command and tried to use it... (16 Replies)
Discussion started by: chiru_h
16 Replies

2. HP-UX

Removing ^D and ^H characters

Hi, I have a very huge file and it contains some unprintable characters like ^H and ^D. If I try to remove using cat test1.ser| tr -d '\136 110'>newfile1 it is only removing ^and all spaces in the file. How can I remove these characters (^D ^H) and keep my spaces as it is? Thanks &... (1 Reply)
Discussion started by: arsheshadri
1 Replies

3. UNIX for Dummies Questions & Answers

removing characters

Hi all, Any help on how to do the following? :eek: I have an infile as follows: _thisishowyouwritehelloworld _thisisalsohowyouwritehelloworld2 I want to delete the characters from "_" to "how" and be left with: youwritehelloworld youwritehelloworld2 I am able to do delete from a... (2 Replies)
Discussion started by: dr_sabz
2 Replies

4. UNIX for Advanced & Expert Users

Removing ^M characters

hi I have a perl script conv.pl. when i execute this file and direct i to log file I see lots of ^M characters in the log file. There is no ^M in conv.pl file. Log file is generated only after conv.pl is executed. Please help as how to get rid of these. This conv.pl is going to get schduled... (0 Replies)
Discussion started by: infyanurag
0 Replies

5. UNIX for Dummies Questions & Answers

Removing ^M characters

hi I have a perl script conv.pl. when i execute this file and direct i to log file I see lots of ^M characters in the log file. There is no ^M in conv.pl file. Log file is generated only after conv.pl is executed. Please help as how to get rid of these. This conv.pl is going to get schduled... (5 Replies)
Discussion started by: infyanurag
5 Replies

6. Shell Programming and Scripting

Removing ^M characters from a file

Hi, I want to removing ^M characters from a file and combine the line with the next line. ex: issue i have: ABC^M^M DEF solution i need: ABCDEF I found that you by using the following command you can remove new line characters. tr -d '\r' < infile.csv > outfile.csv still... (10 Replies)
Discussion started by: mwrg
10 Replies

7. Shell Programming and Scripting

Remove the first character from the fourth column only if the column has four characters

I have a file as follows ATOM 5181 N AMET K 406 12.440 6.552 25.691 0.50 7.37 N ATOM 5182 CA AMET K 406 13.685 5.798 25.578 0.50 5.87 C ATOM 5183 C AMET K 406 14.045 5.179 26.909 0.50 5.07 C ATOM 5184 O MET K... (14 Replies)
Discussion started by: hasanabdulla
14 Replies

8. UNIX for Dummies Questions & Answers

Removing trailing x'0A' characters.

I am trying to remove trailing carriage return (x'0a') from a source program. What is a good way to do this for the whole file? TIA (4 Replies)
Discussion started by: wbport
4 Replies

9. Shell Programming and Scripting

Removing last and first characters in a file

bash-3.00$ cat temp.txt ./a/REA01/ces1/apps/ces_ces1_init3_aa.ear/ces.war/WEB-INF/classes/reds/common/environment.properties ./a/REA01/ces1/apps/ces_ces1_init3_aa.ear/commonproperties/hi/HostIntegration.properties... (9 Replies)
Discussion started by: bhas85
9 Replies

10. Shell Programming and Scripting

How to use regex on particular column (Removing comma from particular column)?

Hi, I have pipe separated file which contains some data having comma(,) in it. I want to remove the comma(,) only from particular column without changing data in other columns. Below is the sample data file, I want to remove the comma(,) only from 5th column. $ cat file1 ABC | DEF, HIJ|... (6 Replies)
Discussion started by: Prathmesh
6 Replies
LIGHTSPEED(1)						      General Commands Manual						     LIGHTSPEED(1)

NAME
lightspeed - Shows how objects moving at speeds near the speed of light look like. SYNOPSIS
lightspeed [-hsa] [object] DESCRIPTION
Light Speed! is a simulator which can illustrate the effects of special relativity on the appearance of objects travelling at ultra-high speeds. Depending on the particular speed, and one's point of view, relativistic effects can cause the object to appear shorter, longer, brighter, darker, deformed and/or off-color. CONTROLS
To adjust the velocity, use the slider along the right edge of the main window. You can also type in a value, using the entry at the top right (press <Enter> once it is in). To change the units shown, press the button to the right of the entry, and it will cycle through a small list. The object travels in the positive-x direction, which can be visually checked by activating Objects -> Coordinate axes. Most interactive control is performed with the mouse. By holding down a particular button, and dragging the pointer around, various camera motions can be obtained: Left button: Revolve camera around view target Left button + Shift key: Revolve view target around camera Middle button: Translate camera left, right, up or down Right button: Dolly in or out The first and last motions are generally the most useful. Should the camera become difficult to control at any point, it may be re-ini- tialized by selecting Camera -> Reset View. OPTIONS
-h, --help Print this help screen -s, --simple Use simplified interface -a, --advanced Use advanced interface (default) object 3D file to load on startup (.3DS or .LWO) April 2000 LIGHTSPEED(1)
All times are GMT -4. The time now is 03:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy