Search Results

Search: Posts Made By: sidnow
1,130
Posted By Scrutinizer
Hi try: awk -F, 'NR==1{print $1,$3,$5}{print...
Hi try:
awk -F, 'NR==1{print $1,$3,$5}{print $2,$4,$6}' file
1,130
Posted By Aia
awk -F, 'BEGIN{print "Name","Age","School"}{print...
awk -F, 'BEGIN{print "Name","Age","School"}{print $2,$4,$6}' sidnow.file
1,825
Posted By MadeInGermany
Another one awk '{printf (/FIND\.Value/ ? rs :...
Another one
awk '{printf (/FIND\.Value/ ? rs : ",") "%s", $0; rs=RS} END {printf rs}' file
1,825
Posted By RavinderSingh13
Hello sidnow, Could you please try following...
Hello sidnow,

Could you please try following and let me know if this helps.

awk '{gsub(/= | =/,"=",$0);} /^Table1/ && A{print A;A=$0;next} {;A=A?A OFS $0:$0} END{print A}' OFS=, Input_file
...
1,825
Posted By Scrutinizer
TrY: awk '/FIND\.Value/{if(s)print s;...
TrY:
awk '/FIND\.Value/{if(s)print s; gsub(FS,x); s=$1; next}{s=s "," $1} END{if(s)print s}' file
5,672
Posted By cfajohnson
That is almost almost always the wrong way ro...
That is almost almost always the wrong way ro read the contents of a file. Not only is cat unnecssary but it will break your script if any lines contain whitespace or other pathological characters....
5,672
Posted By Khanaza
You can also use basename and the dirname to get...
You can also use basename and the dirname to get the output
basename /tmp/abc.txt will give abc.txt
dirname /tmp/abc.txt will give /tmp
5,672
Posted By Aia
That was a good try, but it has a couple syntax...
That was a good try, but it has a couple syntax errors.
Remove the red `$' and add the red `;'

However, that would display path and file in two different lines.
Modify as:

for i in `cat...
7,023
Posted By vgersh99
as the saying goes: use nawk instead of awk on...
as the saying goes: use nawk instead of awk on Solaris...........
7,023
Posted By Corona688
It doesn't work on Linux either. Try this: ...
It doesn't work on Linux either.

Try this:

awk -F"(" '$2 { print substr($2,1,7) }' inputfile
6,529
Posted By Chubler_XL
Agreed, and posting #6 matches the desired input...
Agreed, and posting #6 matches the desired input and output
6,529
Posted By colshine
For ascending order try: ls -l | sort +4n...
For ascending order try:


ls -l | sort +4n


For descending order try:


ls -l | sort +4nr
6,529
Posted By Chubler_XL
how about this this: ls -lh /home/sid | awk...
how about this this:

ls -lh /home/sid | awk '
$9 !~/unwantedfile/{
bytes=$5 * 1024^index("KMGTPEZY", toupper(substr($5,length($5))));
printf "%.0f ", bytes
print $5,$3,$6,$7,$8,$9
} ' |...
Forum: What is on Your Mind? 06-12-2014
2,382
Posted By rbatte1
A few thoughts that might help you:- You might...
A few thoughts that might help you:-
You might need to work on your interfacing
Negotiating access is critical before attempting IO
Ensure you use the agreed port
Take virus protection...
Showing results 1 to 14 of 14

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