Text replacement question.
#1
Posted 14 November 2011 - 11:48 AM
Here are some of the lines I'm working with:
2524>Ranger 700 6x6 EFI Commercial
7890>Ranger 700 Crew
7891>Ranger 700 Crew LE Black Cherry
7892>Ranger 700 Crew LE Browning Hunter Edition
7893>Ranger 700 Crew LE Turbo Silver
2525>Ranger 700 HD
I'm looking for a way to replace the start of each line (e.g. 2524>, 7890>, 7891>) up to the > with blank space so I only end up with the model of these four wheelers (there's many more, that's why I'm trying to figure out an easy way to do this).
Is there a way to automatically do this by using a code in the replace feature, or another way I can do it?
I'm at work and could really use a quick response on this... I need to get these done ASAP.
Thanks.
#2
Posted 14 November 2011 - 12:09 PM
What is Alleycode? Is it an online HTML editor?
#3
Posted 14 November 2011 - 03:31 PM
#4
Posted 15 November 2011 - 09:21 AM
Did you try using their support option? I saw on their main site they had a link for it.
#5
Posted 15 November 2011 - 01:45 PM
By the way Alleycode is pretty popular, I'm surprised you haven't heard of it.
#6
Posted 15 November 2011 - 02:00 PM
Justin90, on 15 November 2011 - 01:45 PM, said:
Are we talking of replacing some text in a .htm or .html file?
Justin90, on 15 November 2011 - 01:45 PM, said:
Popular among WHOM?
I mean like
- Pogrammers
- Web developers
- Kids
- Electricians and Plumbers
- Other
jaclaz
This post has been edited by jaclaz: 15 November 2011 - 02:02 PM
#7
Posted 15 November 2011 - 02:16 PM
jaclaz, on 15 November 2011 - 02:00 PM, said:
Are we talking of replacing some text in a .htm or .html file?
The format doesn't really matter. If you know a code to replace a start of a line to a like symbol (> would be the symbol in this case) then give me the code and I can use it.
Quote
Popular among WHOM?
I mean like
- Pogrammers
- Web developers
- Kids
- Electricians and Plumbers
- Other
Programmers, web developers. My boss uses alleycode every day and created a $7,000+ a day website with it.
This post has been edited by Justin90: 15 November 2011 - 02:19 PM
#8
Posted 15 November 2011 - 02:26 PM
Justin90, on 15 November 2011 - 02:16 PM, said:
It does, rest assured, is the file a TEXT format or a binary one?
Justin90, on 15 November 2011 - 01:45 PM, said:
Well, the fact that your boss made a site with alleycode and that this particuar site makes a 7K bucks a day ( i.e. roughly 2.5 millions US$ per year) are two facts, but not necessarily in a cause-effect relationship.
It should mean that your boss is highly creative and knows very well how to build and promote sites, not necesarily that alleycode is popular among programmers (or at least let's say that I know very few programmers making 2.5 million bucks per year, so it is possible that alleycode is popular among only among this -I presume -restricted group of people, let's call them RICH programmers).
But a programmer would probably know how to replace a few characters in the beginning of each line in a file.
jaclaz
#9
Posted 15 November 2011 - 03:03 PM
jaclaz, on 15 November 2011 - 02:26 PM, said:
As noted, the format is extremely important, especially when dealing with a markup language that uses the same characters you want to replace. We could say a standard "search and destroy" formula such as this would seem ideal:
FIND "*>" REPLACE ""
However, you'd see that HTML uses > in it's markup tags, so using a replace like that would destroy the page. However, another option would be to programmatically do a find/replace where you can look for the specific things you want. If this data were kept in a database, a trim would work fine, but if it is in the text of HTML you'd need to specify something like:
FIND "xxxx>" WHERE (x = numerical value) with ""
Of course your standard find and replace isn't smart enough to do this, so a custom app or script would be required. Then again, the amount of time developing and testing said script until it is done may actually take longer than just changing all those values by hand.
#10
Posted 15 November 2011 - 04:05 PM
jaclaz, on 15 November 2011 - 02:26 PM, said:
^^ What he said. You could make a multi-million dollar site using notepad or any old text editor. That means very little about the text editor, it's more about running a business than anything else. Also, I wouldn't call Alleycode "well known" at all, even in the web development world (and "not at all" as for "traditional" programmers). The big player is obviously Dreamweaver, followed by dozens of small yet somewhat popular apps, including many text editors (notepad++, notepad2, textmate, ultraedit, pspad, gedit, emacs, vim, nano, etc) and several HTML editors (Expression Web, FrontPage before that, Nvu, etc). I've never heard of Alleycode before, and I will be surprised if I ever hear about again.
jaclaz, on 15 November 2011 - 02:26 PM, said:
That kind of task (search and replace strings, with very simple text I/O) is well within reach of scripting newbies, let alone decent programmers. Either ways, it sounds like he can afford to hire someone to do it.
#11
Posted 16 November 2011 - 11:29 AM
Here's why I'm doing this, actually haven't had much time to work on it, only gotten a couple hundred done out of the thousands I have to get. I'm really busy most of the time lol.
______________________________
I'm taking models that look like this -
<option value="6199">Patriot 250</option>
<option value="6200">Patriot 250 MX</option>
I then use replace to remove <option value=", the extra ", and the </option>
Leaving me with:
6199>Patriot 250
6200>Patriot 250
These are models of four wheelers. I will be grabbing thousands of these to be plugging in to a model finder on my bosses websites. It will be entered in as HTML once I get them all done.
So all I need to do I guess is find some code to replace starting at the beginning of the line up to the >.
If using HTML to have the numbers replaced up to the > causes a problem, I can simply change that symbol to anything using the replace feature, so if you know of a code I can use, tell me to change > to whatever it needs to be to get it to work.
Thanks for trying to help and communicate so far guys.
And as for my boss being able to write the code, he's too busy for that, that's why I came to this forum seeking people who like to write code as projects and just mess with code in general to see if I could be helped to get this to go faster.
He's doing a complete overhaul on all of our websites at the moment and is working from home so everyone doesn't bother him about little stuff (this would be classified as more little stuff to him).
Edit: I'm not really sure about the format actually... when I'm done with these I'm saving them as CSV (comma separated values) sheets. I think he just has to go in to the master database and upload them. So no it doesn't really matter what format I change it in.
The object is just to end up with the model number and get it saved to a CSV sheet for uploading, how I get the numbers off doesn't matter at all.
This post has been edited by Justin90: 16 November 2011 - 11:37 AM
#12
Posted 16 November 2011 - 11:50 AM
So if you save something like the following as option.xml:
<Select name="vehicle"> <option value="6199">Patriot 250</option> <option value="6200">Patriot 250 MX</option> </select>
Then in powershell type the following commands, from the directory the option.xml file is in:
[xml]$option = Get-Content .\option.xml
To output to screen:
$option.select.option
To output to file:
$option.select.option | out-file .\options.txt
#13
Posted 16 November 2011 - 12:06 PM
@ECHO OFF&FOR /F "tokens=2 delims=^>" %%A IN (testmodel.csv) do echo %%A>>mymodels.csv
If you have "testmodel.csv" containing:
Quote
6200>Patriot 250 MX
You will get as result a mymodels.csv file containing:
Quote
Patriot 250 MX
Consequently, since I normally invoice a mere 3,600 US$/hour, you owe me 37 US$.
jaclaz
#14
Posted 16 November 2011 - 01:00 PM
#15
Posted 16 November 2011 - 01:09 PM
IcemanND, on 16 November 2011 - 01:00 PM, said:
Well, I make SUBSTANTIAL rebates on my list prices for old-time friends like you
I calculate through a complex algorithm (which I won't fully disclose) that basically takes into account the inverse of the sum of the squares of the Alexa Ranking of the sites owned by the client.
jaclaz
#16
Posted 16 November 2011 - 02:38 PM
jaclaz, on 16 November 2011 - 12:06 PM, said:
@ECHO OFF&FOR /F "tokens=2 delims=^>" %%A IN (testmodel.csv) do echo %%A>>mymodels.csv
Where would I be using this code at jaclaz?
I don't really know where to use it like what program, what part of the program... I'm pretty new to this.
I appreciate your time even though you all are poking fun at me lol.
It's okay I'm a newbie I get it
Edit:
Removed image lol, don't want to keep that on here =o
I tried to save some of the models as testmodels.csv in a text document, and then tried to run the code in cmd prompt (im clueless, just guessing where to use it) and i got "##A was unexpected at this time."
Dang I felt so close to finding the answer, but no more responses...
Thanks for the help if I've exhausted your knowledge on the subject. I appreciate it.
This post has been edited by Justin90: 17 November 2011 - 09:57 AM
#17
Posted 17 November 2011 - 04:45 AM
Justin90, on 16 November 2011 - 02:38 PM, said:
Yes
If you want to run it in a command line (from a command prompt in the same directory where testmodels.csv is) you need to use single percentage signs, as in the following:
Command line:
@ECHO OFF&FOR /F "tokens=2 delims=^>" %A IN (testmodel.csv) do echo %A>>mymodels.csv
Inside a .cmd file:
@ECHO OFF&FOR /F "tokens=2 delims=^>" %%A IN (testmodel.csv) do echo %%A>>mymodels.csv
Justin90, on 16 November 2011 - 02:38 PM, said:
I don't get it
In any case what you posted is an UNreadable screenshot of heavens only know WHAT (beacuse it is unreadable).
IF I had doubted your word about your boss making around 2.5 Millions bucks a year, you would hae needed to send me an authenticated copy of his IRS tax form
jaclaz
#18
Posted 17 November 2011 - 09:23 AM
jaclaz, on 17 November 2011 - 04:45 AM, said:
jaclaz
At a thumbnail size in such low quality, its a wonder why editing out names was even necessary. Except that it can be seen it is MerchantPlus NaviGate. Unfortunately, it is impossible to independently verify the findings using that site since likely both of these cases need to be true:
1. Have an account on that site
2. Have that account on that site
I had indeed found that particular site but alas have no account to log in with. This may be related to the obscure fact that my own website makes absolutely NO money and actually costs me to keep it going.
#19
Posted 17 November 2011 - 09:35 AM
#20
Posted 17 November 2011 - 09:41 AM
- ← HP Notebook: The recovery partition could not be found
- Software Hangout
- Lost partition with value data →



Help

Back to top









