Search Results

Search: Posts Made By: ratheesh2011
2,583
Posted By ratheesh2011
Thank you all
Thank a lot raj_saini20 for your code, it is working fine for my requirement, when I made a small change.

$awk '$1 ~ /ABC/{if(x !~/ABC/){print $0};x=$1}($1 !~ /ABC/){x=$1;print}' inputfile
...
2,583
Posted By ratheesh2011
My code for this
My requirement is extract error records. Output shows error records.

My code is


cnt=1
cat input_file | while read line
do
typ=`echo "$line" | cut -c 1-3`
if [ $cnt -gt 1 ]
then
if [...
2,583
Posted By ratheesh2011
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 ...
3,552
Posted By ratheesh2011
Partially Successful.
Thanks Corona688. This gives the desired output for the given input, it insert a blank line as first record.
Also this is not working if ABC comes as field other than first. I need to consider ABC...
3,552
Posted By ratheesh2011
Not working as expected
Thanks all for your quick reply. But these codes are not working as I expected.
All are writing the input records to output as it is.
Solution from elixir_sinari prefixed a TAB for each record...
3,552
Posted By ratheesh2011
Combine multiple lines in file based on specific field
Hi,

I have an issue to combine multiple lines of a file. I have records as below.
Fields are delimited by TAB. Each lines are ending with a new line char (\n)

Input
--------
ABC 123456...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 01:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy