Search Results

Search: Posts Made By: ziggy6
3,364
Posted By rdrtx1
See update to post #7
See update to post #7
3,364
Posted By rdrtx1
awk '{ c=split($0,a, " *,* *"); for...
awk '{
c=split($0,a, " *,* *");
for (i=1;i<=c;i++) if(a[i] ~ /-/) {w=a[i]; sub(/-/,"",a[i]); a[i]="-"a[i]; sub(w, a[i])}
} 1' Input_file > Output_file
3,364
Posted By RavinderSingh13
Hello ziggy6, Not exactly sure about your...
Hello ziggy6,

Not exactly sure about your complete requirement but based on your statements only this solution is. Could you please try following and let me know if this helps.

awk -F" , "...
1,709
Posted By Aia
Would that work? perl -MPOSIX="strftime" -le...
Would that work?
perl -MPOSIX="strftime" -le 'print strftime("%m/%d/%Y", localtime)'
02/11/2016
1,709
Posted By jim mcnamara
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isd...
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
printf "%02d/%02d/%d\n", $mon+1, $mday, $year + 1900;
printf "raw year: $year\n";
printf "raw month: $mon\n";
printf...
3,462
Posted By Corona688
Pardon me, missing one crucial character from my...
Pardon me, missing one crucial character from my code. Also, the output string should be "\012", since it's not a regular expression like the input is.

Actually, just "\n" will do.

And you...
2,332
Posted By Akshay Hegde
You may try awk $ awk -F";"...
You may try awk

$ awk -F";" '$1==search{print $2}' search="155" file
xyz155@gmail.com
akshay@Aix:/tmp$ cat a
1693;abc1693@yahoo.comt;Tommy D
6423;abc6423@yahoo.comt;Jim Doran...
2,413
Posted By RudiC
Don't use awk for that; use simple shell:while...
Don't use awk for that; use simple shell:while IFS=";" read var1 addr name; do mail -a file -s "Subject" $addr; ...; done < contacts
3,397
Posted By Don Cragun
If I have interpreted your new requirements...
If I have interpreted your new requirements correctly, the following should do what you want:
awk -v my=`(date +%m%y)` -F'[^[:digit:]]*' '
{ out = out $0 "\n"
}
/Account Number:/ {
...
3,397
Posted By Don Cragun
Note that you're setting shell variables mand y,...
Note that you're setting shell variables mand y, but you are not setting the awk variable my.

Even if your shell doesn't recognize $(...), it would still be much easier to set the month and year...
3,397
Posted By Don Cragun
With the input you provided, I get the files: ...
With the input you provided, I get the files:
1000413.txt
1030413.txt
1050413.txt
90413.txt
when I run this script on OS X.

Are you sure that the first line of the script you ran was:
awk -v...
3,397
Posted By Don Cragun
This is a major step in the right direction, but...
This is a major step in the right direction, but the output file names still have not been specified. Do you really want leading spaces on the output file names when customer numbers are less than...
4,130
Posted By edehont
You do a read a in your shell. Then you use $a in...
You do a read a in your shell. Then you use $a in awk, but that won't work because awk knows nothing about shell variables.

When you invoke awk you can however pass variables to it:

awk -v a=$a...
4,130
Posted By ctsgnb
Something like this ? awk -vA="$a" '$5~A{print...
Something like this ?
awk -vA="$a" '$5~A{print "Account Number: "$5}' filename---------- Post updated at 12:04 AM ---------- Previous update was at 12:02 AM ----------

$ X="Statement to: ...
4,130
Posted By bartus11
Try:awk "\$5==$a" filename
Try:awk "\$5==$a" filename
Showing results 1 to 15 of 15

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