Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need once more a little help. I have this string:

/a href="/get.php file=hackmii_installer_v1.0.zip&amp;key=43e7ce13e9818c0b4c5737b7d061005606dfad5e"><b>HackMii Installer v1.0</b></a><br />"><b>HackMii Installer v1.0</b></a><br />

I only need, the part that is in " ", so in this example I would get:

(/get.php?file=hackmii_installer_v1.0.zip&amp;key=43e7ce13e9818c0b4c5737b7d061005606dfad5e) 

I need to read this out and have to delete the not needed parts. Can somebody help me out?

share|improve this question
2  
It looks like you are trying to parse the source of an HTML file. Can you provide more details? If this was the only string in question, you already solved your answer by pasting the result. –  iglvzx Jul 14 '12 at 21:09
    
Why do I get visions of some stupid paperclip popping up when you say that? –  lornix Jul 14 '12 at 21:31
    
@lornix You should join us in the Chat Room. Clippy is a bot there. ;) –  iglvzx Jul 14 '12 at 21:32
add comment

1 Answer

Have you tried pasting the entire string into an editor? notepad, notepad++, wordpad, word, openoffice, libreoffice...

Once there, you can edit and move around the characters however you wish.

THEN.. you can copy & paste the resultant command string into whatever you need.

Now, if you're looking to do it programmatically.. that's a WHOLE 'nother story.


EDIT:

(gee, it was a request for how to do it programmatically...)

sed 's/^[^"]*"\([^"]*\)".*$/\1/' sourcefile > destfile

This would convert your source line into your desired output.

Of course, windows doesn't HAVE sed. Maybe someone can gin up a PowerShell answer? Installing cygwin just seems overkill.

share|improve this answer
    
I do not want to do it manually, but it will happen automatically in a batch, so this is not an option! –  Board Jul 14 '12 at 21:23
3  
you didn't SAY that... we're geeks, we're literal. you said how... not how in a script or program... –  lornix Jul 14 '12 at 21:25
    
sorry next time i try to say what I want '-.- –  Board Jul 14 '12 at 21:26
2  
There is sed for Windows from GnuWin32 gnuwin32.sourceforge.net/packages/sed.htm and UnxUtils sourceforge.net/projects/unxutils. The second one is a single .exe file which is easier to add to your path without installations. –  paradroid Jul 14 '12 at 21:42
    
Thanks, but is ist with C or C++ possible too? I don't want to install any software to reach my goal! I want to do it with programms which I can use with commandline. A simple C-File I convert would be better than to install sed. –  Board Jul 15 '12 at 8:54
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.