Sponsored Content
Top Forums UNIX for Dummies Questions & Answers To print the 1st column using sed Post 302537256 by ctsgnb on Thursday 7th of July 2011 01:15:48 PM
Old 07-07-2011
Quote:
Originally Posted by win4luv
this dint work out for me....I get all the columns when i use this code

sed 's/ .*//' input

Maybe they are tab separated instead of space separated, just change the space before the dot into a tab, otherwise you can give a try to

Code:
tr '\t' ' ' <yourfile | sed 's/ .*//'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Strings from one file which exactly match to the 1st column of other file and then print lines.

Hi, I have two files. 1st file has 1 column (huge file containing ~19200000 lines) and 2nd file has 2 columns (small file containing ~6000 lines). ################################# huge_file.txt a a ab b ################################## small_file.txt a 1.5 b 2.5 ab ... (4 Replies)
Discussion started by: AshwaniSharma09
4 Replies

2. Shell Programming and Scripting

print first few lines, then apply regex on a specific column to print results.

abc.dat tty cpu tin tout us sy wt id 0 0 7 3 19 71 extended device statistics r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 0.0 133.2 0.0 682.9 0.0 1.0 0.0 7.2 0 79 c1t0d0 0.2 180.4 0.1 5471.2 3.0 2.8 16.4 15.6 15 52 aaaaaa1-xx I want to skip first 5 line... (4 Replies)
Discussion started by: kchinnam
4 Replies

3. Shell Programming and Scripting

sed/awk to update 1st column if condition met

Hi, I am trying to update the 1st column of a file but only if it contains a char here is an example of my file 1111aaa 9999 textaaa 22222bbb 9999 textbbb 3333 9999 textccc 444ddd 9999 textddd i would like the output to remove any characters () from... (5 Replies)
Discussion started by: plennon
5 Replies

4. Shell Programming and Scripting

Using sed on 1st column of tab delimited file

Hi all, I'm new to Unix and work primarily in bioinformatics. I am in need of a script which will allow me to replace "1" with "chr1" in only the first column of a file which looks like such: 1 10327 rs112750067 T C . PASS ASP;RSPOS=10327;... (4 Replies)
Discussion started by: Hkins552
4 Replies

5. Shell Programming and Scripting

AWK/SED print if 2nd character in a column is greater than 0

We have an access log where column 8 displays the time in seconds like below: Tj8nQAoNgwsAABov9cIAAAFL - 10.13.131.80 - - (0) - "GET /aaaaa/bbbb/bbbb where column 8 is printed (0). We are trying to find how many entries are there that has column 8 greater than 0. Remember $8 is (0) and not... (5 Replies)
Discussion started by: spacemtn5
5 Replies

6. Shell Programming and Scripting

comparing column of two different files and print the column from in order of 2nd file

Hi friends, My file is like: Second file is : I need to print the rows present in file one, but in order present in second file....I used while read gh;do awk ' $1=="' $gh'" {print >> FILENAME"output"} ' cat listoffirstfile done < secondfile but the output I am... (14 Replies)
Discussion started by: CAch
14 Replies

7. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

8. Linux

Print the 1st column and the value in 2nd or 3rd column if that is different from the values in 1st

I have file that looks like this, DIP-17571N|refseq:NP_651151 DIP-17460N|refseq:NP_511165|uniprotkb:P45890 DIP-17571N|refseq:NP_651151 DIP-19241N|refseq:NP_524261 DIP-19241N|refseq:NP_524261 DIP-17151N|refseq:NP_524316|uniprotkb:O16797 DIP-19588N|refseq:NP_731165 ... (2 Replies)
Discussion started by: Syeda Sumayya
2 Replies

9. UNIX for Beginners Questions & Answers

Compare 1st column from 2 file and if match print line from 1st file and append column 7 from 2nd

hi I have 2 file with more than 10 columns for both 1st file apple,0,0,0...... orange,1,2,3..... mango,2,4,5..... 2nd file apple,2,3,4,5,6,7... orange,2,3,4,5,6,8... watermerlon,2,3,4,5,6,abc... mango,5,6,7,4,6,def.... (1 Reply)
Discussion started by: tententen
1 Replies

10. UNIX for Beginners Questions & Answers

Need to print nth till last column of ls output using sed

I wish to print first, third and sixth till the last column from the output of ls command ls -ltr /app/deploy.yml -rw-rw-r-- 1 user1 dba 27342 Aug 28 10:17 /app/deploy.yml Desired Output: Below command gives me the desired output. ls -ltr /app/deploy.yml | awk '{$2=$4=$5=""; print... (6 Replies)
Discussion started by: mohtashims
6 Replies
DateTime::Locale::ha_Arab(3)				User Contributed Perl Documentation			      DateTime::Locale::ha_Arab(3)

NAME
DateTime::Locale::ha_Arab SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'ha_Arab' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Hausa Arabic. DATA
This locale inherits from the DateTime::Locale::ha locale. It contains the following data. Days Wide (format) XXXXXXXX XXXXXX XXXXXX XXXXXXXXXX XXXXXX XXXXXXXX XXXXXX Abbreviated (format) XXX XXX XXX XXXXX XXX XXXX XXX Narrow (format) XXX XXX XXX XXXXX XXX XXXX XXX Wide (stand-alone) XXXXXXXX XXXXXX XXXXXX XXXXXXXXXX XXXXXX XXXXXXXX XXXXXX Abbreviated (stand-alone) XXX XXX XXX XXXXX XXX XXXX XXX Narrow (stand-alone) L T L A J A L Months Wide (format) XXXXXXXX XXXXXXXXXX XXXXXX XXXXXXXX XXXX XXXXX XXXXX XXXXXXXX XXXXXXXX XXXXXXXXX XXXXXXXX XXXXXXXX Abbreviated (format) XXX XXX XXX XXXXX XXX XXXX XXXX XXXX XXX XXXXX XXX XXX Narrow (format) XXX XXX XXX XXXXX XXX XXXX XXXX XXXX XXX XXXXX XXX XXX Wide (stand-alone) XXXXXXXX XXXXXXXXXX XXXXXX XXXXXXXX XXXX XXXXX XXXXX XXXXXXXX XXXXXXXX XXXXXXXXX XXXXXXXX XXXXXXXX Abbreviated (stand-alone) XXX XXX XXX XXXXX XXX XXXX XXXX XXXX XXX XXXXX XXX XXX Narrow (stand-alone) J F M A M Y Y A S O N D Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide XXXXXXXX XXXXXX XXXXXX Abbreviated XXXXXXXX XXXXXX XXXXXX Narrow XXXXXXXX XXXXXX XXXXXX Date Formats Full 2008-02-05T18:30:30 = XXXXXX, 5 XXXXXXXXXX, 2008 1995-12-22T09:05:02 = XXXXXX, 22 XXXXXXXX, 1995 -0010-09-15T04:44:23 = XXXXXXXX, 15 XXXXXXXX, -10 Long 2008-02-05T18:30:30 = 5 XXXXXXXXXX, 2008 1995-12-22T09:05:02 = 22 XXXXXXXX, 1995 -0010-09-15T04:44:23 = 15 XXXXXXXX, -10 Medium 2008-02-05T18:30:30 = 5 XXX, 2008 1995-12-22T09:05:02 = 22 XXX, 1995 -0010-09-15T04:44:23 = 15 XXX, -10 Short 2008-02-05T18:30:30 = 5/2/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/9/-10 Default 2008-02-05T18:30:30 = 5 XXX, 2008 1995-12-22T09:05:02 = 22 XXX, 1995 -0010-09-15T04:44:23 = 15 XXX, -10 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = XXXXXX, 5 XXXXXXXXXX, 2008 18:30:30 UTC 1995-12-22T09:05:02 = XXXXXX, 22 XXXXXXXX, 1995 09:05:02 UTC -0010-09-15T04:44:23 = XXXXXXXX, 15 XXXXXXXX, -10 04:44:23 UTC Long 2008-02-05T18:30:30 = 5 XXXXXXXXXX, 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22 XXXXXXXX, 1995 09:05:02 UTC -0010-09-15T04:44:23 = 15 XXXXXXXX, -10 04:44:23 UTC Medium 2008-02-05T18:30:30 = 5 XXX, 2008 18:30:30 1995-12-22T09:05:02 = 22 XXX, 1995 09:05:02 -0010-09-15T04:44:23 = 15 XXX, -10 04:44:23 Short 2008-02-05T18:30:30 = 5/2/08 18:30 1995-12-22T09:05:02 = 22/12/95 09:05 -0010-09-15T04:44:23 = 15/9/-10 04:44 Default 2008-02-05T18:30:30 = 5 XXX, 2008 18:30:30 1995-12-22T09:05:02 = 22 XXX, 1995 09:05:02 -0010-09-15T04:44:23 = 15 XXX, -10 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 XXX 1995-12-22T09:05:02 = 22 XXX -0010-09-15T04:44:23 = 15 XXXX Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 P.M. 1995-12-22T09:05:02 = 9:05 A.M. -0010-09-15T04:44:23 = 4:44 A.M. Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 P.M. 1995-12-22T09:05:02 = 9:05:02 A.M. -0010-09-15T04:44:23 = 4:44:23 A.M. M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, d-M) 2008-02-05T18:30:30 = XXX, 5-2 1995-12-22T09:05:02 = XXX, 22-12 -0010-09-15T04:44:23 = XXXX, 15-9 MMM (LLL) 2008-02-05T18:30:30 = XXX 1995-12-22T09:05:02 = XXX -0010-09-15T04:44:23 = XXX MMMd (d MMM) 2008-02-05T18:30:30 = 5 XXX 1995-12-22T09:05:02 = 22 XXX -0010-09-15T04:44:23 = 15 XXX MMMEd (E d MMM) 2008-02-05T18:30:30 = XXX 5 XXX 1995-12-22T09:05:02 = XXX 22 XXX -0010-09-15T04:44:23 = XXXX 15 XXX MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 XXXXXXXXXX 1995-12-22T09:05:02 = 22 XXXXXXXX -0010-09-15T04:44:23 = 15 XXXXXXXX MMMMEd (E d MMMM) 2008-02-05T18:30:30 = XXX 5 XXXXXXXXXX 1995-12-22T09:05:02 = XXX 22 XXXXXXXX -0010-09-15T04:44:23 = XXXX 15 XXXXXXXX ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, d/M/yyyy) 2008-02-05T18:30:30 = XXX, 5/2/2008 1995-12-22T09:05:02 = XXX, 22/12/1995 -0010-09-15T04:44:23 = XXXX, 15/9/-010 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 XXX 1995-12-22T09:05:02 = 1995 XXX -0010-09-15T04:44:23 = -10 XXX yMMMEd (EEE, d MMM y) 2008-02-05T18:30:30 = XXX, 5 XXX 2008 1995-12-22T09:05:02 = XXX, 22 XXX 1995 -0010-09-15T04:44:23 = XXXX, 15 XXX -10 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 XXXXXXXXXX 1995-12-22T09:05:02 = 1995 XXXXXXXX -0010-09-15T04:44:23 = -10 XXXXXXXX yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week XXXXXXXX SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::ha_Arab(3)
All times are GMT -4. The time now is 11:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy