| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> but atm i have more of an issue p***ing info from a sub call for some reason <1> which was why standards were installed to begin with eh?> :) <0> i have my(@email, <2> Complexity leads to variety in implementation <0> err <0> i have my(@email,%header)=&imap_viewmail($imap,$mailbox,$id); <1> longword been at that Guiness, Again <0> and that sub returns (@in,%header) <3> i would like to replace spaces and dots in filenames with a "-", but keep the file suffix (e.g. *.html). any ideas please? <0> but %header isn't returning correctly for some reason
<0> ValeFiona same suggestion i always have, write a perl script hehe <1> perl? LOL <3> yeah, but when i asked for hints on some perl channels i got not so nice replies :) <0> well if one knew sed and bash you could do it that way too <0> hmm seems perl doesn't like it when you p*** array back before hash, if you p*** hash then array it works <1> p*** da hash? <0> yea it wants the hash first, go figure hehe <1> bad code! <3> the most headache i have about "this.file.name.has.dots.html" and replacing the dots with "-", except the suffix part so i get "this-file-name-has-dots.html" <3> should i extract the sub string ".html" first, delete it from the main string, then replace "." with "-" and copy the sub string back to the main string? <1> look out for splinters luv <3> meanie :( <1> i guess :) <4> ValeFiona: Solved your problem? <3> gcbirzan, i am trying to cut off the ".html" bit, then replace the "." with "-" and put the ".html" back. but thats not workie <3> i think i have "awk & sed cookbook" flying around somewhere <3> brb <5> so you want something like s/.html/-.html/ <3> not exactly. i try to get this: "this.file.name.has.dots.html" to --> "this-file-name-has-dots.html" <5> ahhhh. <5> s/\./-/g; s/-html/.html/ <5> it's a two-liner <5> or a two-segment. <5> echo "$filename" | sed -n -e 's/\./-/g' -e 's/-html$/.html/' <3> woah, thats much easier than my idea, cool :) <5> ValeFiona: err, try it out first. Please. <1> yeah even though Viking667 is only 1 score off of being evil, hes good >G< <3> the idea alone works much better than mine :) <3> lol Gaia^ <1> :) <1> ValeFiona but im a 'meanie' <5> ValeFiona: actually, strip out the -n for sed. <5> woof.... <1> oh 'fun' :( <5> ValeFiona: so, make it: echo "$filename" | sed -e 's/\./-/g' -e 's/-html$/.html/'
<3> for I in ('ls *.html') ... | sed ... | xargs -0 mv $I <3> about that? <0> oh for the love of chips why didn't someone write a list of freakin commands and fields for this damn thing <6> ValeFiona: I haven't been paying much attention, but have you looked at rename? it's often a better choice for m*** renaming than mv <3> oh, but then i need a perl expression instead of sed magic <6> well, ymmv.. which is why I said often and not always ;) <6> and there's usually more than one way to do things in linux anyway <3> true that <7> don't say things that are usually said regarding perl about linux <8> you're fired! <8> .o <3> lol <8> gah <8> smalband ****s <0> damn.... <3> for I in `ls *.pdf`; do mv $I `sed -e 's/\./-/g' -e 's/-html$/.html/'`; done <-- looks quite nice but does nothing :( <3> errr, oops. the suffix does not fit <5> lol. <5> actually, you would have had all the . changed into - <3> nah, same <5> whew <5> That's why I said - PRACTICE. <3> i have to abord with CTRL-C <3> abort even <5> yup. <3> so there is a logic error, not a syntax error? <3> http://paste.getlinuxhelp.org/2004 <-- woah! i got it working :) <9> ValeFiona: are you the same as Fiona? <9> what does sed do exactly Viking? <5> SSigSeg: look up its' man page. <9> oh <5> Because I can't describe it in anything less detailed than that. <5> "Stream Editor" <9> Ladybyte sed <10> Sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). Sed is located at ftp://ftp.gnu.org/pub/gnu/sed/ or a pain in the ***, or see http://www-h.eng.cam.ac.uk/help/tpl/unix/sed.html for common usages and examples <9> I never think of her :) thanks Ladybyte <3> Viking667, what do i put when i want to replace a space instead of "."? <9> ValeFiona: #include <stdio.h>, int main(){ char c; while((c = getchar()) != EOF){ if(c == ' ') putchar('<some replacement character>'); else putchar(c); return 0; } <3> thanks SSigSeg, but i try to do my first steps on SED first
Return to
#linuxhelp or Go to some related
logs:
apt-get dimsum #AllNiteCafe google earth.deb #AllNiteCafe #php _GetBaseMessageMap .NET migration
netforce misskitten voice reconition for sql coding #linux ajax irc client
|
|