Search Results

Search: Posts Made By: mrpugster
2,766
Posted By mrpugster
sed help with character removal
Hello

I've got a string of text with a number in pence, e.g. 0.52p, I need to remove the 'p' so that it just reads 0.52 without of course removing all the other 'p' characters.

Many thanks
1,111
Posted By mrpugster
sed pattern match problem
Hi all, hoping this is a simple one, tried looking but just can't see the solution

As an example I've got a list of words that all start Ben.....

Bendicks
Benefiber
Ben
Benylin

I need to...
4,325
Posted By mrpugster
A fantastic little script, thanks. I'm still...
A fantastic little script, thanks. I'm still going to try to scrape the brands directly from the source website but should that fail this will do perfectly. :-)
4,325
Posted By mrpugster
Wow didn't realise that, the website that I...
Wow didn't realise that, the website that I scraped the data from also has the duplicates! They are a big company with lots of developers you'd think they would have noticed :-)
4,325
Posted By mrpugster
I'm afraid automatically generating the brand...
I'm afraid automatically generating the brand list is harder than I initially thought. I will still continue to look at this. The support forum for the website for the scrape software is currently...
4,325
Posted By mrpugster
The file is initially generated using a piece of...
The file is initially generated using a piece of web scraping software, I've just had a look at the web pages I do the scrape from, it looks like I can produce a scrape of all the brand names.
4,325
Posted By mrpugster
Hi The raw data comes from a website scrape...
Hi

The raw data comes from a website scrape and contains 12000 products name but no brands names, e.g.

Filippo Berio Mild & Light Olive Oil (500ml)

What I've done initially is to the get...
4,325
Posted By mrpugster
Unfortunately I've got around 1500 of these...
Unfortunately I've got around 1500 of these brands, I guess there's no getting away from cleaning up the data first with a separator. :-)
4,325
Posted By mrpugster
Hi Michael or anyone I'm having trouble with...
Hi Michael or anyone

I'm having trouble with AWK and with products which have an apostrophe in the name, .i.e.

Fisherman's Friend

I've tried escaping the character with \ and putting it in...
4,325
Posted By mrpugster
Thank you CTSGNB, interesting solution of yours. ...
Thank you CTSGNB, interesting solution of yours.

As I've only got 40 or so of these I think I'll carry on the the AWK solution, something like this:

awk '/Filippo Berio/{print $0 FS...
4,325
Posted By mrpugster
Ah ha ----- perfect :-) You just saved me lots of...
Ah ha ----- perfect :-) You just saved me lots of manual find and replace.

---------- Post updated at 04:38 AM ---------- Previous update was at 04:28 AM ----------

Hi again

I've got 40+ of...
4,325
Posted By mrpugster
Hi Michael, thanks for you kind help, that's...
Hi Michael, thanks for you kind help, that's really close but it's only doing the change on every other line, I'll try to explain:

Here's my input file, I've left some of the other columns in,...
4,325
Posted By mrpugster
Sorry if the above isn't clear, hopefully this is...
Sorry if the above isn't clear, hopefully this is easier to understand.

Sample

Product Brand
Weight Watchers Apricot...
4,325
Posted By mrpugster
String copy
Hi guys

I've got two columns, PRODUCT and BRAND, the Brand column currently has the first word of each product, I've acheived this by using SED to copy the first word of the PRODUCT column,...
1,046
Posted By mrpugster
File comparision with AWK / SED
Hi all

I need to compare two separate product lists that are changed weekly. New products are added, old products are removed and prices change.

I have found various Windows programs that do...
1,338
Posted By mrpugster
Sed decimal issue
Hi

I've been trying to add a decimal place to a list of weights in a file but have been having problems with the decimal place for the Kg.

I can convert the g weights with this code:
sed -i...
9,433
Posted By mrpugster
Hi Dan, thanks for you script - works great...
Hi Dan, thanks for you script - works great however I need it to keep the 'g' and 'Kg' characters in there, at the moment it strips them out, is there anyway with AWK to do this?

Regards
758
Posted By mrpugster
sed problem
Hi there

In my product weight listing I have a huge list of numbers, however some of these listings have a preceding line e.g. "4 per pack - " the number can range from 1 to 500.

I've been...
9,433
Posted By mrpugster
Sed, numbers and multiplication
Hi there.

I've used Sed to pull out some numbers, can it also be used to perform calculations on these numbers?

For example I have a text file with a list of weights however some of them are...
1,459
Posted By mrpugster
Many thanks to both of you, went with the Sed...
Many thanks to both of you, went with the Sed option in the end and worked a treat!

Merci
1,459
Posted By mrpugster
Sed question
Hi there. I've managed to do some basic find and replace with Sed but need to do something a little trickier and it has me stumped!

I've a text file with several thousand rows like the ones...
4,176
Posted By mrpugster
that's pretty neat, i'm looking at doing a...
that's pretty neat, i'm looking at doing a nslookup on those ip's too, that's easy to do but obviously generates lots of output, can I apply a pattern match once more to the results to just give me...
4,176
Posted By mrpugster
thanks red, i'm beginning to see how powerful...
thanks red, i'm beginning to see how powerful perl can be, never used it before. if i wanted to execute commands, such as ping each of those IP's, I can just create a simple 'for' loop:

for $1...
4,176
Posted By mrpugster
Thanks, all solved now, however I want to do the...
Thanks, all solved now, however I want to do the same thing but generate a list of IP addresses that are in many different files within a directory using AWK, can you search for an IP string pattern?...
2,545
Posted By mrpugster
Many thanks Jim, it was on SuSe but I managed to...
Many thanks Jim, it was on SuSe but I managed to fix it just after I posted haha
Showing results 1 to 25 of 27

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