I posted this message to awk forum but other solutions are accepted too.
Hi
Does anybody have an idea how to remove leading zeros from this data ie. to transform this
HD000245
HD001358
HD020400
HD000093
HD000007
........
to
HD245
HD1358
HD20400
HD93
HD7
.......
thanks
o
Hi
I would like to put a function into .bashrc file that would:
open a new Konsole and cd into the result of pwd command. Something like:
pwdinnk() {
p=`echo pwd`
echo $p
`dcop $KONSOLE_DCOP newSession`
`cd $p`
}
This does not work. In details:
1. The echo $p part does not give me...
thanks Feherke
And what to do in this case ... I want to write out some columns like:
awk 'BEGIN {FS=",";OFS=","}
/^#/{next} {print $58,1/($63*$63)}'
file.csv file > file1.csv
As you see, I skeep header because 1/($63*$63) operation would report error if I do not skeel it. But steel I...
Hi All
Is it posible to use awk with gnuplot? That is, can I plot data directly extracted from file by awk like:
awk 'BEGIN {FS=","}{print $53, $58}' | gnuplot ...
thanks
oliver
Hi All,
I can not find any documentation on what is the difference when I define some variable in .bashrc file like for example:
COS_PATH=+$COSSPEC2D_DIR/pro:$COS_PATH
and
COS_PATH=$COSSPEC2D_DIR/pro:$COS_PATH
(ie without +). Could somebody tell me?
Also I am not sure when to export...
Hi All,
I join 2 files matching columns like
awk 'BEGIN{FS=",";OFS=","}
NR==FNR{a[$1]=$1;b[$1]=$23;c[$1]=$44;next} $1 in a {print a[$1],$1,b[$1],c[$1], $2, $3, $4, $5}'
filq
e1.csv file2.csv > joined.csv
I have headers in file1.csv and file2,csv.How to keep corresponding headers in...
sory...Ygor's suggestion with cut works and
awk 'BEGIN{FS=",";OFS=","}{$1=$6="";gsub(FS "+",FS)}1' file.dat > newFile.dat
leave ',' in front of each line
thanks
I have a csv file and I would like to keep like that. This try does not work if I want to remuve 1 column (i.e it leaves ',' in front of lines)
awk 'BEGIN{FS=",";OFS=","}{$1=$6="";gsub(FS "+",FS)}1' file.dat > newFile.dat
Feherke's suggestion is OK
hi All,
I would like to delete 2 columns from 60 columns data. How to do that except to write
awk '{print $1, $2 .... $60}' file.dat > newFile.dat
leaving out columns that I dont want in a newFile.dat?
thanks
oliver
thanks.
this works
expr match "$fileName" '.*box'
but how come that
expr match "$fileName" '.*_tri'
does not find the position of '_'(ie the position of the end of the number)?
o.
Hi All,
I would like to extract numbers 5, 15, 35 from filenames like (the second number in name):
join5x_angle_box5_tri.dat
join5x_angle_box15_tri.dat
join5x_angle_box35_tri.dat
....
How to do this?
I was thinking to apply command like
`expr index "$fileName" '.*box.*'`
in a loop, but...
hi,
could somebody tell what is wrong with this command
awk 'BEGIN {"read c" | getline vc close("read c"); print vc}'
the idea is to read in some variable from STDIN and to use it in awk commands
thanks
oliver
paste is ok but after pasting I can not read in the obtained file as an ASCII with some Windows programs since it put some characters in the file. unix2dos does not help
thanks Columb
I use Cygwin and I am very very new in Unix. I read manual every time befor posting but sometimes I can not understand everything so I post question here.
hi
I would like to copy files that find command finds somehow. None of this does not work
find less/DH* more/DH* -type f -name "all*.dat" -exec cp "c:\users\"
find less/DH* more/DH* -type f -name "all*.dat" | cpio -pdumv "c:\users\"
how to do properly this?
thanks
oliver
hi
I would like to normalize second column of dataFile to number at 1000 row of second column. I do this by looking what number I have in 1000th row of second column first and then
awk'{print $1, $2/23.45}' file
Must be an easier way to do this I am sure. some suggestions?
thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.