Script for changing a csv separator for all file into .zip archive....
Hi, i need to make a sh script that find all .zip files in all
subdirectories of a path, modify the .csv files inside the zip file,
change the ',' separator into ';' and then save all files .csv and
overwrite .zip files...any suggestions?
many thanks
Re: Script for changing a csv separator for all file into .zip archive....
On 2006-07-10, drain <spremuta@gmail.com> wrote:
[color=blue]
> Hi, i need to make a sh script that find all .zip files in all
> subdirectories of a path, modify the .csv files inside the zip file,
> change the ',' separator into ';' and then save all files .csv and
> overwrite .zip files...any suggestions?
> many thanks[/color]
Not really a HP question.
If you've got the bottle you could post this to two competing language
groups asking which is better for the task and if you're lucky someone
will provide working code as an attempt at proving superiority.
Don't forget to say whether quoted commas need to be handled too (i.e.
left unchanged) and pre-existing semis need to be quoted. Have an answer
ready for the people who say that the new files should be called .ssv
instead of .csv .
--
Elvis Notargiacomo master AT barefaced DOT cheek
[url]http://www.notatla.org.uk/goen/[/url]
One of my other 11 computers runs Minix.
Re: Script for changing a csv separator for all file into .zip archive....
all mail refused ha scritto:
[color=blue]
>
> Not really a HP question.
>
> If you've got the bottle you could post this to two competing language
> groups asking which is better for the task and if you're lucky someone
> will provide working code as an attempt at proving superiority.
>
> Don't forget to say whether quoted commas need to be handled too (i.e.
> left unchanged) and pre-existing semis need to be quoted. Have an answer
> ready for the people who say that the new files should be called .ssv
> instead of .csv .[/color]
You'right, i thought to post here because the script should be run on
an hp ux system, thanks for you're suggestions :)
Regards
Re: Script for changing a csv separator for all file into .zip archive....
[email]elvis-85383@notatla.org.uk[/email] wrote:
: > i need to make a sh script that find all .zip files in all
: > subdirectories of a path, modify the .csv files inside the zip file,
: > change the ',' separator into ';' and then save all files .csv and
: > overwrite .zip files...any suggestions?
: > many thanks
: Not really a HP question.
Right. I would suggest using find, (with read or a for loop depending on
how many) then unzip, then a for loop with either
sed or awk, then zip.
If you want some perl gurus, you ask on one ITRC forum:
[url]http://forums1.itrc.hp.com/service/forums/categoryhome.do?admit=-682735245+1152948032760+28353475&categoryId=150[/url]