Author Topic: SPACE age kinda stuff here  (Read 967 times)

Doogee

  • VIP
  • Member
  • ***
  • Posts: 774
  • Kudos: 109
    • http://m-db.info
SPACE age kinda stuff here
« on: 3 January 2003, 04:18 »
Hey all.

I have a folder of files i want to upload to the net, but i cant do it because some have spaces. is there any little thing i could write to replace the  spaxes in the filename and put underscores there instead?

There are a few with no spaces. so it would need to leave them alone.


Thanks

-Dan

Stryker

  • VIP
  • Member
  • ***
  • Posts: 1,258
  • Kudos: 41
SPACE age kinda stuff here
« Reply #1 on: 3 January 2003, 04:28 »
Very simple...


i'd do something like this:
tar -zcvf files.tgz my\ first\ file.bmp my\ second\ file.exe

would put 'my first file.bmp' and 'my second file.exe' into files.tgz

good luck

Doogee

  • VIP
  • Member
  • ***
  • Posts: 774
  • Kudos: 109
    • http://m-db.info
SPACE age kinda stuff here
« Reply #2 on: 3 January 2003, 04:47 »
people downloading the files will be primarily winders users, they wont do the tar thing. is there a way to pkzip or something like that. Also all these files need to be seperate

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
SPACE age kinda stuff here
« Reply #3 on: 3 January 2003, 04:57 »
this will replace spaces in all the files in the current directory with underscores. There may be a quicker way to do this; I'm never really sure when it comes to Bash scripting when you have spaces in filenames.

find -name "*\ *" | while read ITEM; do mv "$ITEM" `echo "$ITEM" | sed -e 's/\ /_/g'`; done
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


Doogee

  • VIP
  • Member
  • ***
  • Posts: 774
  • Kudos: 109
    • http://m-db.info
SPACE age kinda stuff here
« Reply #4 on: 3 January 2003, 05:20 »
quote:
Originally posted by flap:
this will replace spaces in all the files in the current directory with underscores. There may be a quicker way to do this; I'm never really sure when it comes to Bash scripting when you have spaces in filenames.

find -name "*\ *" | while read ITEM; do mv "$ITEM" `echo "$ITEM" | sed -e 's/\ /_/g'`; done




Thanks big time, worked a charm.

beltorak0

  • Member
  • **
  • Posts: 223
  • Kudos: 0
    • http://www.angelfire.com/realm/beltorak
SPACE age kinda stuff here
« Reply #5 on: 3 January 2003, 07:28 »
actually newer versions of winzip handle tar.gz (tarballs) well enough.  if you would rather "zip" them for winderz users try the "zip" commands.  man zip.

btw, unzip can take a self-extracting ".exe" and unzip it in case you ever have need...

-t.
from Attrition.Org
 
quote:
Like many times before, Microsoft is re-inventing the wheel and opting for something other than round.

-t.


Doogee

  • VIP
  • Member
  • ***
  • Posts: 774
  • Kudos: 109
    • http://m-db.info
SPACE age kinda stuff here
« Reply #6 on: 3 January 2003, 07:49 »
hrmm i really cant figure out how to use the zip command but i am in need of it because this host wont let me upload the files because of an "unknown extension"

preacher

  • VIP
  • Member
  • ***
  • Posts: 858
  • Kudos: 107
    • http://kansascity.cjb.net
SPACE age kinda stuff here
« Reply #7 on: 3 January 2003, 21:35 »
quote:
Originally posted by Got Doogee?:
people downloading the files will be primarily winders users, they wont do the tar thing. is there a way to pkzip or something like that. Also all these files need to be seperate


I know for a fact that winzip can handle tar files.
Kansas City Hustle
http://kansascity.cjb.net

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
SPACE age kinda stuff here
« Reply #8 on: 3 January 2003, 16:34 »
quote:
Originally posted by Got Doogee?:
hrmm i really cant figure out how to use the zip command but i am in need of it because this host wont let me upload the files because of an "unknown extension"


here is the solution:

make tar.gz files out of them, then add ".zip" to the end of the filename so:

"doogeesasspix.tar.gz" would become "doogeesasspix.tar.gz.zip" or "doogeesasspix.zip"

note all you do here is change the filename. Then upload the stuff and your host will think they are zip files. The windows users will download them and think they are zip files and they will open them with winzip. in fact if the user has winzip installed, they will be set to open these files with that by default. The net effect for the end user is exactly the same as if you made them zip files in the first place.

Personally i would leave the .tar.gz in the filename since any non windows users will need that sort of clue to what kind of file it is once they find out it's not a 'real' zip file.
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
SPACE age kinda stuff here
« Reply #9 on: 3 January 2003, 17:31 »
quote:
Originally posted by Calum:
note all you do here is change the filename. Then upload the stuff and your host will think they are zip files. The windows users will download them and think they are zip files and they will open them with winzip. in fact if the user has winzip installed, they will be set to open these files with that by default. The net effect for the end user is exactly the same as if you made them zip files in the first place.


I'm afraid that won't work. Although winzip can handle both filetypes it still needs to determine which one it's opening. If it's a tarball and the extension's telling it it's a zip, it will assume it's an invalid archive.
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


Doogee

  • VIP
  • Member
  • ***
  • Posts: 774
  • Kudos: 109
    • http://m-db.info
SPACE age kinda stuff here
« Reply #10 on: 3 January 2003, 18:21 »
hrmm well its geocities, so does anyone have any ideas to trick those dumbasses?

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
SPACE age kinda stuff here
« Reply #11 on: 3 January 2003, 18:46 »
To use the zip utility you just do
zip filename.zip filestozip
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


Doogee

  • VIP
  • Member
  • ***
  • Posts: 774
  • Kudos: 109
    • http://m-db.info
SPACE age kinda stuff here
« Reply #12 on: 3 January 2003, 19:00 »
Telstra wont mind me hazing ROMS on there servers would they? as long as i have all the necessary disclaimers.

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
SPACE age kinda stuff here
« Reply #13 on: 4 January 2003, 04:26 »
they won't even notice i am sure.
quote:
Originally posted by flap:


I'm afraid that won't work. Although winzip can handle both filetypes it still needs to determine which one it's opening. If it's a tarball and the extension's telling it it's a zip, it will assume it's an invalid archive.



this works on windows 2000, i swear to you. have not tried it on other versions though.
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

Doogee

  • VIP
  • Member
  • ***
  • Posts: 774
  • Kudos: 109
    • http://m-db.info
SPACE age kinda stuff here
« Reply #14 on: 4 January 2003, 21:28 »
haha my goodness Bigponds Web hosting thing is dismal, 10 MB space and 100megs per month of data transfer. lol no thankyou. anyone know any GOOD free hosting places? noone here has a server with a bitta space on it do they?