Search Results

Search: Posts Made By: liuzhencc
1,905
Posted By RudiC
Try awk -F, -vn=10 ' {for (i=1; i<=n;...
Try awk -F, -vn=10 '
{for (i=1; i<=n; i++) {printf "%s", i
for (j=0; j<i; j++) printf "%s%+f", (j%4?"":j?ORS i:"") OFS, $(++c)
...
2,746
Posted By RudiC
Similar problems have been covered in these fora...
Similar problems have been covered in these fora several times. How about giving it a go and come back with the solution should difficulties arise?
1,835
Posted By RudiC
For several files, you might trypaste file1 file2...
For several files, you might trypaste file1 file2 | awk '
{for (i=0; i<=1; i+=.1) print $1, $2+i*($6-$2), $3+i*($7-$3), $4+i*($8-$4) > "FILE"i}
' OFS="\t" OFMT="%12.8f" CONVFMT="%3.1f"
1,835
Posted By RudiC
WHAT? That description leaves a wide field for...
WHAT? That description leaves a wide field for speculations! However, with wildest guessing I came up withpaste file1 file2 | awk '{print $1, $2+(NR-1)/10*($6-$2), $3+(NR-1)/10*($7-$3),...
2,350
Posted By RudiC
Make print T<10?10:T > "file2" --> print...
Make print T<10?10:T > "file2" --> print T+0<10?10:T > "file2"
2,350
Posted By RudiC
In the other thread...
In the other thread (https://www.unix.com/302945697-post7.html) , try to replace the VIBFREQV action with
/VIBFREQV/ {print 3 * FC
for (i=3; i<=5; i++)
...
2,350
Posted By RudiC
Try awk '{print $1<10?10:$1 >"file2"; sub(/-/,_);...
Try awk '{print $1<10?10:$1 >"file2"; sub(/-/,_); print >"file1"}' file

---------- Post updated at 13:07 ---------- Previous update was at 13:04 ----------

If I remember correctly, you had...
2,350
Posted By sea
Hi Zhen You know the drill, what have you...
Hi Zhen

You know the drill, what have you tried yourself?
You could:
1) use read line, 'ignore' the first line, and then do checks on every later line (num)
2) use some awk

Thank you
1,966
Posted By RudiC
This is as far as I get on first attempt; use it...
This is as far as I get on first attempt; use it as a template to be enhanced. For the correct order of lines of information, it might be worthwhile to create a template form to be read and then...
3,044
Posted By Akshay Hegde
Don't set field sep -F=, modify like this ...
Don't set field sep -F=, modify like this

awk '/NAtoms/{print $2}' infile
6,619
Posted By Corona688
My program, on reflection, isn't even close to...
My program, on reflection, isn't even close to what you want anyway.

paste might be closer, if your data is all in the same order and guaranteed not missing any rows.

Is it?

Please answer my...
6,619
Posted By senhia83
I will do this in 3 steps. 1. Extracting the...
I will do this in 3 steps.

1. Extracting the first column from any of the files, add a blank line and store in a file.
awk 'NR==1{print ""} {print $1}' file1 > ../tmpcol1


2. Paste all col2...
873
Posted By RudiC
Pipe it through qsum | sed -n '/free/,/^$/p' ...
Pipe it through qsum | sed -n '/free/,/^$/p'
free
p105 73800mb 48:00:00
p106 150000mb 48:00:00
p107 150000mb 48:00:00

assuming above is the output of qsum...
999
Posted By Scrutinizer
Hi, just replace the last 1 with {printf...
Hi,
just replace the last 1 with {printf "%10s%10d%10s%10s%10s%10d%10.3f%10.3f%10.3f%5.2f%5.2f%10s\n",$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}
and remove
OFS='\t'
999
Posted By Scrutinizer
OK Zhen. That seems straightforward. Do you need...
OK Zhen. That seems straightforward. Do you need the formatting preserved or would this do?
awk '
END {
print "TER",NR+1
for(i=1; i<=NR; i++) print "CONNECT", i,...
Showing results 1 to 15 of 15

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