Search Results

Search: Posts Made By: DallasT
1,911
Posted By Yoda
Assuming records are in increasing time order:- ...
Assuming records are in increasing time order:-
awk '!f&&/Time=15:56:26/{f=1;next}/Time=16:33:45/{exit 1}f&&/SystemDEF=E2S/&&/Calc=33W2/' file
1,911
Posted By Corona688
grep does not have less than, greater than, if,...
grep does not have less than, greater than, if, then, and, etc. So it's not much use for comparing time.

awk does, though. If your times are in HH:MM:SS format they are easy enough to compare.
...
1,911
Posted By Yoda
awk...
awk '!f&&/Time=15:56:26/{f=1;next}f&&/SystemDEF=E2S/&&/Calc=33W2/' file
1,911
Posted By RudiC
And how do you get at records AFTER that target...
And how do you get at records AFTER that target time? Assuming that records are in increasing time order, try

awk -F"|" '$4=="Time=15:50:26" {P=1} P && $2 ~ /=E2S$/ && $3 ~/=33W2$/' msgfile...
2,252
Posted By Skrynesaver
If I want the first 10 lines ${command that...
If I want the first 10 lines
${command that generates more results than I want} | head -10
And if I want the last 10
${command that generates more results than I want} | tail -10
3,846
Posted By Don Cragun
When you are shown that fgrep on some systems has...
When you are shown that fgrep on some systems has a --color option (as in the fgrep man page excerpt vgersh99 provided), the way to get color output from fgrep would be:
fgrep --color -i...
3,846
Posted By vgersh99
fgrep -i "XYZ-1124354-P" --color...
fgrep -i "XYZ-1124354-P" --color mylog.log
1,355
Posted By vgersh99
sorry: awk 'FNR==NR {fb[$1];next} !($1 in...
sorry:

awk 'FNR==NR {fb[$1];next} !($1 in fb)' fileB fileA
1,032
Posted By Aia
Are you talking about this? awk '!/Message/ &&...
Are you talking about this?
awk '!/Message/ && /=/ {for (i=1; i<=NF; i++){split($i, a, "=");print a[1]}}' file1
Is that not working for you?
That's the output of both messages back to back
1,032
Posted By MadeInGermany
If after a split() the a[1] gave the right side...
If after a split() the a[1] gave the right side then try a[0]
1,032
Posted By Aia
awk '/^Message/{print;next}; /=/{for (i=1; i<=NF;...
awk '/^Message/{print;next}; /=/{for (i=1; i<=NF; i++)print $i}' file1
or
awk '!/Message/ && /=/ {for (i=1; i<=NF; i++)print $i}' file1
1,032
Posted By Aia
If you don't care about anything in the other...
If you don't care about anything in the other lines:
awk '!/Message/ && /=/ {for (i=1; i<=NF; i++){split($i, a, "=");print a[1]}}' file1

If you want to separate them by messages:
awk...
1,032
Posted By vgersh99
awk -F'[= ]' '/^Message/ {print;next};...
awk -F'[= ]' '/^Message/ {print;next}; NF{for(i=1;i<=NF;i+=2) print $(i)}' myFile
10,954
Posted By Corona688
What do you want the output to look like?
What do you want the output to look like?
10,954
Posted By Corona688
Your file practically is that already. Add...
Your file practically is that already. Add carriage returns, load it into excel as CSV, and see what you get.

( printf "Name,Quantity,Type,Status\r\n" ; sed 's/$/\r/g' ) < input > output.csv
10,954
Posted By Akshay Hegde
With some assumption that your file might look...
With some assumption that your file might look like this...
$ cat file
Name (ABCD) Quantity (34), Type (456), Status (2324)

$ cat tester
awk 'FNR==1{
gsub(/,/,OFS,head)
print head...
2,740
Posted By SriniShoo
if you have the passwordless ssh set-up between...
if you have the passwordless ssh set-up between the server you are running the script and the target hostnames,
STRING='myipaddress.somehost.com'
DEST_PATH='/somedir/somedir/somedir'...
1,529
Posted By SriniShoo
awk '1' ORS='|' foo.dat ---------- Post...
awk '1' ORS='|' foo.dat

---------- Post updated at 01:24 PM ---------- Previous update was at 01:23 PM ----------

tr '\n' '|' < foo.dat
1,407
Posted By SriniShoo
%s/mytestscrip.com:33232/mytestscript:70245\/test....
%s/mytestscrip.com:33232/mytestscript:70245\/test.com/g
1,040
Posted By rangarasan
grep
Hi,
Try this,

grep -i "TracingMyNewMessage\[PRIVATE_TESTINGSYSTEM-04PQ\]" mylog.dat


Here [ and ] are special characters.

Cheers,
Ranga:)
2,798
Posted By joeyg
Perhaps adding the following will help
$ cat sample6.txt
LaxOrdID=15378205
-> LaxOrdID=15737366<8>
-> LaxOrdID=16520504<8>

$ cat sample6.txt | awk '{print $NF}'
LaxOrdID=15378205
LaxOrdID=15737366<8>
LaxOrdID=16520504<8>

What...
1,551
Posted By bartus11
chmod 755 mytest.pl
chmod 755 mytest.pl
2,152
Posted By bartus11
grep -i 'SBT' test.txt >> myfile.txt
grep -i 'SBT' test.txt >> myfile.txt
3,198
Posted By jim mcnamara
awk ' /SBE/ {for(i=1;i<=NF;i++)...
awk ' /SBE/ {for(i=1;i<=NF;i++) {if(index($i,"SBE")==1) {print $i } } } {next} ' inputfile
3,198
Posted By bartus11
grep -oE 'SBE[^, ]*' test.txt
grep -oE 'SBE[^, ]*' test.txt
Showing results 1 to 25 of 35

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