Search Results

Search: Posts Made By: mikey11415
5,768
Posted By mikey11415
This works. But on my real dataset, I still have...
This works. But on my real dataset, I still have a problem.

The problem is that I need

sed -E -e "s/ord[^[:space:]]+//g" file.txt

With "ord" to work, too. So it needs to be "wild carded"...
5,768
Posted By mikey11415
Partial Match and Replace
Hi, I have a tab delimited text file like this one. I need to do a partial match of a particular cell and then replace matches with an empty cell. So here is a sample:
...
3,281
Posted By mikey11415
Hm, that doesn't seem to be working. I tried...
Hm, that doesn't seem to be working. I tried using tr with [:digit:] but with no use. Any other ideas? Sorry I am not proficient with sed

---------- Post updated at 10:37 PM ---------- Previous...
3,281
Posted By mikey11415
Replacing a character between two numbers
Hi, I need to replace a character between two numbers (specifically a - to a _). The problem is that they can be *any* numbers. So, I need a one liner to turn a file like this:

1-2
3-4
55-66...
1,028
Posted By mikey11415
PERFECT! Thank you!
PERFECT! Thank you!
1,028
Posted By mikey11415
Sorting by columns
Hi, I have a tab delimited columnar file where I want to remove lines wherever two particular columns match. so for this file, I want to toss the lines where columns 1 and 2 match:
a a 1 3
a b 2 4...
981
Posted By mikey11415
Make all lines divisible by three
Hi,

I need some help with the following: I need all lines in a file divisible by three, so for a file like this:

1
11
111

I want to add characters to make them all divisible by three...
1,149
Posted By mikey11415
Linking two tasks in a script
Hi, I have a question.

I have a file that I need to do two things to.

The first thing I need to do is turn a file with lines before and after a line with the term "Acceptance" into only the...
3,517
Posted By mikey11415
Replace lower case letters with N
Hi,
I have a string of letters that are upper and lower case. I would like to replace all the lowercase letters with N. Also, there are only 4 letters, so it may be easier to replace each lower...
1,782
Posted By mikey11415
THANK YOU AGAIN! There was a missing curly...
THANK YOU AGAIN!

There was a missing curly bracket in there on the second line. I must be a real expert now ;)


NR==1
NR>1{ for (i=1; i<=NF; i++) { a[i]+=$i; }}
END { if (NR > 1) {...
1,782
Posted By mikey11415
Turn an awk one liner into a script?
Hi,
I was just helped with an excellent one liner. Now I need to know how to turn it into a script that I can call at the command line. So, this works with file script:

------------
for file...
7,946
Posted By mikey11415
Hi, Thanks! Well, the first two columns,...
Hi, Thanks!
Well, the first two columns, Iteration and Tree No are actually both not significant to me. But, I figured that whatever code would be easiest if it could be applied to all columns. ...
7,946
Posted By mikey11415
Averaging Data From Multiple Columns, Using Header if Possible
Hi,

I have a file with multiple tab delimited columns and I would like to have the average of each column:

Iteration Tree No Lh HMean
1000 1 -78.834717 -78.834717 ...
3,343
Posted By mikey11415
thanks AGAIN!
thanks AGAIN!
3,343
Posted By mikey11415
sed remove two headers; writing more elegant code
Hi there,

I have two questions. First, I was wondering how to use sed to remove two header lines or two tail lines. Here I just do the same operation twice...I'm sure there is a better way. ...
2,218
Posted By mikey11415
Perfect!!! Thanks!
Perfect!!!
Thanks!
2,218
Posted By mikey11415
reducing the number of characters in a column
Hi,
I would like to take the first column of a bunch of lines and take only the 6th through 15th characters. The first column are not regular.


gbAY277147.1Ptv3.T1469 CTTGAACAT...
16,895
Posted By mikey11415
hm when I use awk '{printf( "%s\n", $1 ) }'...
hm
when I use
awk '{printf( "%s\n", $1 ) }' ZZline_char > ZZline_char1

it prints each number onto a separate line. the thing is that i want the first column from two rows from ZZline_char on...
16,895
Posted By mikey11415
well i did this cat ZZlinecount ZZcharcount...
well i did this

cat ZZlinecount ZZcharcount > ZZline_char #make one file from two
awk '{printf $1 " "}' ZZline_char > ZZline_char1 #get the first column


and that WORKED...
16,895
Posted By mikey11415
Thanks! I just can't believe how much you are...
Thanks!
I just can't believe how much you are helping me solve a major issue!!!
I have another couple of questions.
I needed to rearrange some of the columns in the datafile.
I was able to do...
16,895
Posted By mikey11415
and what i meant by horrify was about my horrible...
and what i meant by horrify was about my horrible newbie script!!!
16,895
Posted By mikey11415
OK, here is something to horrify the unix...
OK, here is something to horrify the unix programmers. here i am trying to analyze the datafile "fake", i am trying to do a couple of things

take the lines between matrix and end.
remove first...
16,895
Posted By mikey11415
Wow, agama, thanks! ok, this is my first...
Wow, agama, thanks!

ok, this is my first real use of awk, more or less. here goes:

/_X/ || /_Y/
means search for exactly _X or _Y
print that line, then move onto the next line
then, there...
16,895
Posted By mikey11415
how to add duplicate lines
Hi,
I have a file that looks like this:

a_X data
a_Y data
b data
c data
d_X data
d_Y data

I **want** to duplicate the lines without the _X and _Ys. In other words, I want it to look...
Forum: OS X (Apple) 08-13-2009
4,578
Posted By mikey11415
Problem using a top command alias in my profile
Hi-

I am newish to the mac osx unix interface. I want to set up top so that it always displays the username. I can use this command to do this:

top -ocpu -P ' PID COMMAND %CPU TIME ...
Showing results 1 to 25 of 25

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