Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Select records based on search criteria on first column Post 91465 by shashi_kiran_v on Friday 2nd of December 2005 10:30:26 AM
Old 12-02-2005
Select records based on search criteria on first column

Hi All,

I need to select only those records having a non zero record in the first column of a comma delimited file.

Suppose my input file is having data like:

"0","01/08/2005 07:11:15",1,1,"Created",,"01/08/2005"
"0","01/08/2005 07:12:40",1,1,"Created",,"01/08/2005"
"552130000","01/08/2005 07:16:53",2,3,"FIDS_Accept",,"01/08/2005"

Then I need the output having only

"552130000","01/08/2005 07:16:53",2,3,"FIDS_Accept",,"01/08/2005"

Thanks
Shash
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete new lines based on search criteria

Hi all! A bit of background: I am trying to create a script that formats SQL statements. I have gotten so far as to add new lines based on certain match criteria like commas, keywords etc. In the process, I end up adding newlines where I don't want. For example: substr(colName, 1, 10)... (3 Replies)
Discussion started by: jayarkay
3 Replies

2. Shell Programming and Scripting

substract column based on some criteria

Please guide if you know how to solve this. I have a tab delimited INPUT FILE where each record is separated by ----- ----- ABC 4935402 4936680 Pattern=Cheers07080.1 ABC 4932216 4932368 Pattern=Cheers07080.1 ABC 4931932 4932122 ... (8 Replies)
Discussion started by: sam_2921
8 Replies

3. Shell Programming and Scripting

Extract data based on specific search criteria

I have a huge file (about 2 millions records) contains data separated by “,” (comma). As part of the requirement, I can't change the format. The objective is to remove some of the records with the following condition. If the 23rd field on each line start with 302 , I need to remove that from the... (4 Replies)
Discussion started by: jaygamini
4 Replies

4. Shell Programming and Scripting

Select only top "N" records based on column value

Hi Gurus, I know this'll be simple task for all the geeks out here but me being a newbie is finding it hard to crack this shell. Ok coming to the task I've a delimited file as below ================================================== ==================================================== ... (8 Replies)
Discussion started by: asandy1234
8 Replies

5. UNIX for Dummies Questions & Answers

How to select files based on a criteria?

I have a file..... xxx 2345 455 abc 345 555 cdf 456 777 fff 555 888 Now my requirement is, Say if, i want to select only those records prior to the record fff 555 888... how do i go about doing this in unix.... The fff would be hardcoded as it wud be fixed and everytime when i... (7 Replies)
Discussion started by: saggiboy10
7 Replies

6. Shell Programming and Scripting

Extract error records based on specific criteria from Unix file

Hi, I look for a awk one liner for below issue. input file ABC 1234 abc 12345 ABC 4567 678 XYZ xyz ght 678 ABC 787 yyuu ABC 789 7890 777 zxr hyip hyu mno uii 678 776 ABC ty7 888 All lines should be started with ABC as first field. If a record has another value for 1st... (7 Replies)
Discussion started by: ratheesh2011
7 Replies

7. Shell Programming and Scripting

Select lines from a file based on a criteria

Hi I need to select lines from a txt file, I have got a line starting with ZMIO:MSISDN= and after a few line I have another line starting with 'MOBILE STATION ISDN NUMBER' and another one starting with 'VLR-ADDRESS' I need to copy these three lines as three different columns in a separate... (3 Replies)
Discussion started by: Tlcm sam
3 Replies

8. Shell Programming and Scripting

Need To Delete Lines Based On Search Criteria

Hi All, I have following input file. I wish to retain those lines which match multiple search criteria. The search criteria is stored in a variable seperated from each other by comma(,). SEARCH_CRITERIA = "REJECT, DUPLICATE" Input File: ERROR,MYFILE_20130214_11387,9,37.75... (3 Replies)
Discussion started by: angshuman
3 Replies

9. Shell Programming and Scripting

Copying section of file based on search criteria

Hi Guru's, I am new to unix scripting. I have a huge file with user details in it(file2) and I have another file with a list of users(file1). Script has to search a user from file1 and get all the associated lines from file2. Example: fiel1: cn=abc cn=DEF cn=xyx File 2: dn:... (10 Replies)
Discussion started by: Samingla
10 Replies

10. Shell Programming and Scripting

Awk/sed/cut to filter out records from a file based on criteria

I have two files and would need to filter out records based on certain criteria, these column are of variable lengths, but the lengths are uniform throughout all the records of the file. I have shown a sample of three records below. Line 1-9 is the item number "0227546_1" in the case of the first... (15 Replies)
Discussion started by: MIA651
15 Replies
PACEMAKER(8)						  System Administration Utilities					      PACEMAKER(8)

NAME
Pacemaker - Part of the Pacemaker cluster resource manager SYNOPSIS
iso8601 command [output modifier] DESCRIPTION
iso8601 - Display and parse ISO8601 dates and times OPTIONS
-?, --help This text -$, --version Version information -V, --verbose Increase debug output Commands: -n, --now Display the current date/time -d, --date=value Parse an ISO8601 date/time. Eg. '2005-01-20 00:30:00 +01:00' or '2005-040' -p, --period=value Parse an ISO8601 date/time with interval/period (wth start time). Eg. '2005-040/2005-043' -D, --duration=value Parse an ISO8601 date/time with duration (wth start time). Eg. '2005-040/P1M' -E, --expected=value Parse an ISO8601 date/time with duration (wth start time). Eg. '2005-040/P1M' Output Modifiers: -s, --seconds Show result as a seconds since 0000-001 00:00:00Z -S, --epoch Show result as a seconds since EPOCH (1970-001 00:00:00Z) -L, --local Show result as a 'local' date/time -O, --ordinal Show result as an 'ordinal' date/time -W, --week Show result as an 'calendar week' date/time For more information on the ISO8601 standard, see: http://en.wikipedia.org/wiki/ISO_8601 AUTHOR
Written by Andrew Beekhof REPORTING BUGS
Report bugs to pacemaker@oss.clusterlabs.org Pacemaker 1.1.10-29.el7 June 2014 PACEMAKER(8)
All times are GMT -4. The time now is 08:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy