From: PJ-UK on 12 May 2010 14:01 Hi all, I been trying all sorts and nothing works what I am trying to do is this to convert cut n paste from a website and convert the info to an CSV file to be imported into a excel worksheet. However upon from cut n paste from website into Word (via text file to strip out images) the Word ends looking like this... Weapons Revolver 3 Attack 2 Defense Owned: 1 Pair of Brass Knuckles 2 Attack 2 Defense Owned: 37 Add to Wishlist Send Gift Police Baton 23 Attack 22 Defense Owned: 1 .22 Pistol 2 Attack 0 Defense Owned: 463 Add to Wishlist Send Gift Sub Machine Gun 24 Attack 22 Defense Owned: 3 Using a series of replace macros I manage to get it ending up like this... Weapons, , , , Revolver, 3 Attack 2 Defense, Owned: 1, Pair of Brass Knuckles, 2 Attack 2 Defense, Owned: 37, Add to Wishlist Send Gift, Police Baton, 23 Attack 22 Defense, Owned: 1, .22 Pistol, 2 Attack 0 Defense, Owned: 463, Add to Wishlist Send Gift, Sub Machine Gun, 24 Attack 22 Defense, Owned: 3, Butterfly Knife, 2 Attack 1 Defense, Owned: 417, Add to Wishlist Send Gift, Just 1 more step to make it a full imprtable working date CSV is to place all the info on it's own row, thus to give something like this... Weapons, , , , Revolver, 3 Attack 2 Defense, Owned: 1, Pair of Brass Knuckles, 2 Attack 2 Defense, Owned: 37, Add to Wishlist Send Gift, Police Baton, 23 Attack 22 Defense, Owned: 1, ..22 Pistol, 2 Attack 0 Defense, Owned: 463, Add to Wishlist Send Gift, Sub Machine Gun, 24 Attack 22 Defense, Owned: 3, Butterfly Knife, 2 Attack 1 Defense, Owned: 417, Add to Wishlist Send Gift, I can easily strip out all reference to add to wishlist send gift lines once it manage to get it looking like this, I am stumped at this final stage of the macro, can anyone advise me or give me ideas to try? I tried wildcard but problem is using wildcard dont actually repace the actual data but instead gives what the replace box give for example Find box: Owned:*, and then Replace box: Owned:*,^p would give Owned:*, and new line but does not retain the amount I have owned... Thanks everyone for your time, PJ
From: Doug Robbins - Word MVP on 12 May 2010 17:21 Do an search and replace for "Add to Wishlist Send Gift" and replace it with ^p^&^p Do a wildcard search for "(Owned: [0-9]{1,})" and replace it with \1^p See the article "Finding and replacing characters using wildcards” at: http://www.word.mvps.org/FAQs/General/UsingWildcards.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "PJ-UK" <PJUK(a)discussions.microsoft.com> wrote in message news:9F7953DC-7911-413E-A236-CB31C54C3964(a)microsoft.com... > Hi all, I been trying all sorts and nothing works what I am trying to do > is > this to convert cut n paste from a website and convert the info to an CSV > file to be imported into a excel worksheet. > > However upon from cut n paste from website into Word (via text file to > strip > out images) the Word ends looking like this... > > Weapons > > Revolver > 3 Attack 2 Defense > Owned: 1 > Pair of Brass Knuckles > 2 Attack 2 Defense > Owned: 37 > Add to Wishlist Send Gift > Police Baton > 23 Attack 22 Defense > Owned: 1 > .22 Pistol > 2 Attack 0 Defense > Owned: 463 > Add to Wishlist Send Gift > Sub Machine Gun > 24 Attack 22 Defense > Owned: 3 > > Using a series of replace macros I manage to get it ending up like this... > > Weapons, , , , > Revolver, 3 Attack 2 Defense, Owned: 1, Pair of Brass Knuckles, 2 > Attack 2 Defense, Owned: 37, Add to Wishlist Send Gift, Police Baton, 23 > Attack 22 Defense, Owned: 1, .22 Pistol, 2 Attack 0 Defense, Owned: 463, > Add to Wishlist Send Gift, Sub Machine Gun, 24 Attack 22 Defense, Owned: > 3, Butterfly Knife, 2 Attack 1 Defense, Owned: 417, Add to Wishlist Send > Gift, > > Just 1 more step to make it a full imprtable working date CSV is to place > all the info on it's own row, thus to give something like this... > > Weapons, , , , > Revolver, 3 Attack 2 Defense, Owned: 1, > Pair of Brass Knuckles, 2 Attack 2 Defense, Owned: 37, > Add to Wishlist Send Gift, > Police Baton, 23 Attack 22 Defense, Owned: 1, > .22 Pistol, 2 Attack 0 Defense, Owned: 463, > Add to Wishlist Send Gift, > Sub Machine Gun, 24 Attack 22 Defense, Owned: 3, > Butterfly Knife, 2 Attack 1 Defense, Owned: 417, > Add to Wishlist Send Gift, > > I can easily strip out all reference to add to wishlist send gift lines > once > it manage to get it looking like this, I am stumped at this final stage of > the macro, can anyone advise me or give me ideas to try? I tried wildcard > but problem is using wildcard dont actually repace the actual data but > instead gives what the replace box give for example Find box: Owned:*, and > then Replace box: Owned:*,^p would give Owned:*, and new line but does not > retain the amount I have owned... > > Thanks everyone for your time, PJ
From: Gordon Bentley-Mix on 12 May 2010 18:32 Mafia Wars? Mate, you got too much time on your hands... -- Cheers! Gordon Bentley-Mix "PJ-UK" <PJUK(a)discussions.microsoft.com> wrote in message news:9F7953DC-7911-413E-A236-CB31C54C3964(a)microsoft.com... > Hi all, I been trying all sorts and nothing works what I am trying to do > is > this to convert cut n paste from a website and convert the info to an CSV > file to be imported into a excel worksheet. > > However upon from cut n paste from website into Word (via text file to > strip > out images) the Word ends looking like this... > > Weapons > > Revolver > 3 Attack 2 Defense > Owned: 1 > Pair of Brass Knuckles > 2 Attack 2 Defense > Owned: 37 > Add to Wishlist Send Gift > Police Baton > 23 Attack 22 Defense > Owned: 1 > .22 Pistol > 2 Attack 0 Defense > Owned: 463 > Add to Wishlist Send Gift > Sub Machine Gun > 24 Attack 22 Defense > Owned: 3 > > Using a series of replace macros I manage to get it ending up like this... > > Weapons, , , , > Revolver, 3 Attack 2 Defense, Owned: 1, Pair of Brass Knuckles, 2 > Attack 2 Defense, Owned: 37, Add to Wishlist Send Gift, Police Baton, 23 > Attack 22 Defense, Owned: 1, .22 Pistol, 2 Attack 0 Defense, Owned: 463, > Add to Wishlist Send Gift, Sub Machine Gun, 24 Attack 22 Defense, Owned: > 3, Butterfly Knife, 2 Attack 1 Defense, Owned: 417, Add to Wishlist Send > Gift, > > Just 1 more step to make it a full imprtable working date CSV is to place > all the info on it's own row, thus to give something like this... > > Weapons, , , , > Revolver, 3 Attack 2 Defense, Owned: 1, > Pair of Brass Knuckles, 2 Attack 2 Defense, Owned: 37, > Add to Wishlist Send Gift, > Police Baton, 23 Attack 22 Defense, Owned: 1, > .22 Pistol, 2 Attack 0 Defense, Owned: 463, > Add to Wishlist Send Gift, > Sub Machine Gun, 24 Attack 22 Defense, Owned: 3, > Butterfly Knife, 2 Attack 1 Defense, Owned: 417, > Add to Wishlist Send Gift, > > I can easily strip out all reference to add to wishlist send gift lines > once > it manage to get it looking like this, I am stumped at this final stage of > the macro, can anyone advise me or give me ideas to try? I tried wildcard > but problem is using wildcard dont actually repace the actual data but > instead gives what the replace box give for example Find box: Owned:*, and > then Replace box: Owned:*,^p would give Owned:*, and new line but does not > retain the amount I have owned... > > Thanks everyone for your time, PJ
From: PJ-UK on 16 May 2010 09:46 Doug, Thank you soo much for that, made a slight adjustment to make it work but ti works cheers for that. "Doug Robbins - Word MVP" wrote: > Do an search and replace for "Add to Wishlist Send Gift" and replace it with > ^p^&^p > > Do a wildcard search for "(Owned: [0-9]{1,})" and replace it with \1^p > > See the article "Finding and replacing characters using wildcards” at: > > http://www.word.mvps.org/FAQs/General/UsingWildcards.htm > > > -- > Hope this helps. > > Please reply to the newsgroup unless you wish to avail yourself of my > services on a paid consulting basis. > > Doug Robbins - Word MVP, originally posted via msnews.microsoft.com > > "PJ-UK" <PJUK(a)discussions.microsoft.com> wrote in message > news:9F7953DC-7911-413E-A236-CB31C54C3964(a)microsoft.com... > > Hi all, I been trying all sorts and nothing works what I am trying to do > > is > > this to convert cut n paste from a website and convert the info to an CSV > > file to be imported into a excel worksheet. > > > > However upon from cut n paste from website into Word (via text file to > > strip > > out images) the Word ends looking like this... > > > > Weapons > > > > Revolver > > 3 Attack 2 Defense > > Owned: 1 > > Pair of Brass Knuckles > > 2 Attack 2 Defense > > Owned: 37 > > Add to Wishlist Send Gift > > Police Baton > > 23 Attack 22 Defense > > Owned: 1 > > .22 Pistol > > 2 Attack 0 Defense > > Owned: 463 > > Add to Wishlist Send Gift > > Sub Machine Gun > > 24 Attack 22 Defense > > Owned: 3 > > > > Using a series of replace macros I manage to get it ending up like this... > > > > Weapons, , , , > > Revolver, 3 Attack 2 Defense, Owned: 1, Pair of Brass Knuckles, 2 > > Attack 2 Defense, Owned: 37, Add to Wishlist Send Gift, Police Baton, 23 > > Attack 22 Defense, Owned: 1, .22 Pistol, 2 Attack 0 Defense, Owned: 463, > > Add to Wishlist Send Gift, Sub Machine Gun, 24 Attack 22 Defense, Owned: > > 3, Butterfly Knife, 2 Attack 1 Defense, Owned: 417, Add to Wishlist Send > > Gift, > > > > Just 1 more step to make it a full imprtable working date CSV is to place > > all the info on it's own row, thus to give something like this... > > > > Weapons, , , , > > Revolver, 3 Attack 2 Defense, Owned: 1, > > Pair of Brass Knuckles, 2 Attack 2 Defense, Owned: 37, > > Add to Wishlist Send Gift, > > Police Baton, 23 Attack 22 Defense, Owned: 1, > > .22 Pistol, 2 Attack 0 Defense, Owned: 463, > > Add to Wishlist Send Gift, > > Sub Machine Gun, 24 Attack 22 Defense, Owned: 3, > > Butterfly Knife, 2 Attack 1 Defense, Owned: 417, > > Add to Wishlist Send Gift, > > > > I can easily strip out all reference to add to wishlist send gift lines > > once > > it manage to get it looking like this, I am stumped at this final stage of > > the macro, can anyone advise me or give me ideas to try? I tried wildcard > > but problem is using wildcard dont actually repace the actual data but > > instead gives what the replace box give for example Find box: Owned:*, and > > then Replace box: Owned:*,^p would give Owned:*, and new line but does not > > retain the amount I have owned... > > > > Thanks everyone for your time, PJ >
|
Pages: 1 Prev: Find and Replace Macro Next: Word 2003 - Force Page Info Field Refresh/Repagination Via Macro |