Search Results

Search: Posts Made By: cavanac2
11,961
Posted By cavanac2
Thanks for awk/gawk
Awesome thanks, that works great!

Best,
11,961
Posted By cavanac2
Hi, Apologies, ive been looking at this for...
Hi,

Apologies, ive been looking at this for so long, i forget that its actually not that clear.

The original file that i am working with looks somthing like this





In the first colum...
11,961
Posted By cavanac2
Iterating over a list using awk, when variable
Hi,

I've recently started using Awk commands as i need it to pull information out of a file and give me the mean value of a series of numbers. Here is the code i run on my Infile and it works just...
1,570
Posted By cavanac2
Perfect
Thanks so much, that worked like a dream!:o
1,570
Posted By cavanac2
How i input a pattern into a file where it does not exist
I have a strange problem and i am wondering the best way to tackel it.

i have hundres of files. in each of these files i would like to see a representative of each of my animals at the start of...
5,623
Posted By cavanac2
That awk command works perfectly, thanks (",) ...
That awk command works perfectly, thanks (",)

The sed command, is almost there, thanks for the grep -o tip :P I changed it up so it now recognises the variable

grep -o 'PBZ' FileIn | wc -l |...
5,623
Posted By cavanac2
testing
Now be aware, my understanding of awk is limited, so im sorry if i offend with my bad code

I tested
awk '/PBZ/{s=$0;$0=(gsub("PBZ","") RS $0)}1' FileIn

however it gave me this
3...
5,623
Posted By cavanac2
Grep char count & pipe to sed command
Nope, thats not it :(

grep -c 'PBZ' FileIn gives me a count of 1, and unfortunatly its still not reading through to the sed command.

welcome to my hell!
5,623
Posted By cavanac2
Grep char count & pipe to sed command
Hi
I am having a 'grep' headache
Here is the contents of my file:

(PBZ,CP,(((ME,PBZ,BtM),ON),((ME,((PBZ,DG),(CW9,PG11))),CW9,TS2,RT1)))

I would like to count out how many times 'PBZ' occurs...
2,004
Posted By cavanac2
Numerical Labeling using sed
Dear All,

Thank you so much, i wasnt expecting so many replies on this. Really enjoyed the three different options here, awk, perl and sed.

Thanks again,
2,004
Posted By cavanac2
Numerical Labeling using sed
Hi,

I have been working on this problem, but could only get so far. I have a file that looks like this

(cat,chimp,(((dog,cat,cow),orangutan),((horse,((cat,dog),(cow,pig))),cat,mouse,rat)));
...
8,641
Posted By cavanac2
sed command, make multiple lines into one
:confused:Hi,

I'm relativley new at unix so am having difficulties at the most basic of areas. I am trying using sed to make multiple lines into one line.

For example, i would like:

Mary...
48,259
Posted By cavanac2
Using grep output as input for sed command
you will have to forgive me, i am still very much in the beginning learning stages here

Basically i have a file1 which has one line of information which i need to place into a specific position in...
48,259
Posted By cavanac2
Using grep output as input for sed command
Thank you so much, this has made my day.

Just had one adjustment, and that was to switch the 'target' and the 'source' for the find and replace to work correctly (",)


#! /bin/ksh

grep...
48,259
Posted By cavanac2
Using grep output as input for sed command
Hi,

Thanks much, unfortunatly, its not quite what i need. I need to be able to go into my FileB and using the grep output from FileA do a replace command on one of my words in file A with the grep...
48,259
Posted By cavanac2
Using grep output as input for sed command
Hi,

I would like to know if this is possible, and if so what can i do to make this work.

I would like to grep a line X from fileA and then use the output to replace a word Y in fileB.

grep...
Showing results 1 to 16 of 16

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