ID incorrect field values in dat file and output to new file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ID incorrect field values in dat file and output to new file
# 1  
Old 02-04-2013
ID incorrect field values in dat file and output to new file

Hi All

I have a .dat file, the values are seperated by ". I wish to identify all field values in field 14 that are not '01-APR-2013' band then copy those records to a new file. Can anyone suggest the UNIX command required.

Thanks in advance
Andy
# 2  
Old 02-04-2013
untested:
Code:
awk '$14 !~ /01-APR-2013/' FS="\."  .dat > newfile

This User Gave Thanks to RudiC For This Post:
# 3  
Old 02-04-2013
Thanks Rudi. Perfect!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to look up values in File 2 from File 1, & printingNth field of File1 based value of File2 $2

I have two files which are the output of a multiple choice vocab test (60 separate questions) from 104 people (there are some missing responses) and the question list. I have the item list in one file (File1) Item,Stimulus,Choice1,Choice2,Choice3,Choice4,Correct... (5 Replies)
Discussion started by: samonl
5 Replies

2. Shell Programming and Scripting

Replace a field where values are null in a file.

Hi, I've a pipe delimited file and wanted to replace the 3rd field to 099990 where the values are null. How can I achieve it using awk or sed. 20130516|00000061|02210|111554|03710|2|205069|SM APPL $80-100 RTL|S 20130516|00000061|02210|111554|03710|2|205069|SM APPL $80-100 RTL|S... (12 Replies)
Discussion started by: rudoraj
12 Replies

3. Shell Programming and Scripting

Count the field values in a file

Hi I have a file with contents like : 101,6789556897,0000795369 - seq - fmt_recs187] - avg_recs 101,4678354769,0000835783 - seq - fmt_recs98] - avg_recs 221,5679787008,0001344589 - seq - fmt_recs1283] - avg_recs I need to find the sum of the all the values (which are in bold). here... (6 Replies)
Discussion started by: rkrish
6 Replies

4. Shell Programming and Scripting

Plz Help. Compare 2 files field by field and get the output in another file.

Hi Freinds, I have 2 files . one is source.txt and second one is target.txt. I want to keep source.txt as baseline and compare target.txt. please find the data in 2 files and Expected output. Source.txt 1|HYD|NAG|TRA|34.5|1234 2|CHE|ESW|DES|36.5|134 3|BAN|MEH|TRA|33.5|234... (5 Replies)
Discussion started by: i150371485
5 Replies

5. Shell Programming and Scripting

Compare two files Field by field and output the result in another file

Hi Friends, Need Help. I have file1.txt as File1.txt |123|A|7267|Hyder|Cross|Sell|7801 |995|A|7051|2008|Lunar|New|Year|Promotion|7801 |996|A|7022|Q108|Targ|Prospect|&|SSCC|Savings|Promo|7801 |997|A|7182|Q1|Feb-Apr|08|Credit|ITA|PA|SBA|Campaign|7801 File2.txt... (7 Replies)
Discussion started by: i150371485
7 Replies

6. Shell Programming and Scripting

sending field values in columns to output file

Hi, I am trying to send output from a shell scrip to a txt file in a colum format. I have all I can and I dont seem to understand why the results from one one particular file keeps going to the next line. How can I force all to be in one line Please see code and output below The is... (0 Replies)
Discussion started by: asemota
0 Replies

7. Shell Programming and Scripting

Merge lines in a file with Awk - incorrect output

Hi, I would like: FastEthernet0/0 is up, line protocol is up 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 output errors, 0 collisions, 0 interface resets Serial1/0:0 is up, line protocol is up 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 0... (14 Replies)
Discussion started by: mv652
14 Replies

8. Shell Programming and Scripting

Getting Distinct values from second field in a file....

Hi I have a pipe delimited file. I am trying to grab the DISTINCT value from the second field. The file is something like: 1233|apple|ron 1234|apple|elephant 1235|egg|man the output I am trying to get from second field is apple,egg (apple coming only once) Thanks simi (4 Replies)
Discussion started by: simi28
4 Replies

9. Programming

Extracting Field values for XML file

i have an input file of XML type with data like <nx-charging:additional-parameter name="NX_INTERNATIONALIZED_CLID" value="919427960829"/><nx-charging:finalStatus>RESPONSE , Not/Applicable , OK</nx-charging:finalStatus></nx-charging:process> i want to extract data such that i get the output... (3 Replies)
Discussion started by: junaid.nehvi
3 Replies

10. Shell Programming and Scripting

How to sort a field in a file having date values

Hi All, I am having a pipe delimited file .In this file the 3rd column is having date values.I need to get the min date and max date from that file. I have used cut -d '|' test.dat -f 3|sort -u But it is not sorting the date .How to sort the date column using unix commands Thanks ... (4 Replies)
Discussion started by: risshanth
4 Replies
Login or Register to Ask a Question