galexander
Well-known member
- Joined
- Jun 24, 2007
- Messages
- 192
- Reaction score
- 0
- Points
- 0
csh script file decoding....
csh script file decoding....
here is some old code i had laying around. this is how to take a bunch of files in a directory and process them. the original files had headers before compressed data, so this removes the header and decodes the files. so the original files would be something like bigfile.001, bigfile.002,... the result would be bigfile. you can easily modify the headers/footers.
this runs under linux/solaris/qnx/irix/cygwin
#!/bin/csh
# Very good when you have a bunch of file appended into one file
# and don't want to go through the boring procedure of deleting
# all the headers and footers.
foreach fil ($argv)
echo "Extracting data..."
echo -n $fil
grep ^begin $fil | nawk '{print " => "$3}'
nawk '{\
if ($0~"^begin") {print ; goon = 1};\
if ($0~"^end") {print ; exit};\
if (goon == 1) {\
if (($0 !~ "[a-z]") && ((length > 4) && (length < 62))||(length==1)) print}\
}' $fil > $fil.make
echo "Decoding info..."
uudecode $fil.make <---here is where you need to put in your command
echo ""
end
csh script file decoding....
...stuff deleted ........
I was looking into Perl and Python today. Maybe I do write it myself. This language seems quite easy. I'm starting an open source project. Anyone interested in helping out???
here is some old code i had laying around. this is how to take a bunch of files in a directory and process them. the original files had headers before compressed data, so this removes the header and decodes the files. so the original files would be something like bigfile.001, bigfile.002,... the result would be bigfile. you can easily modify the headers/footers.
this runs under linux/solaris/qnx/irix/cygwin
#!/bin/csh
# Very good when you have a bunch of file appended into one file
# and don't want to go through the boring procedure of deleting
# all the headers and footers.
foreach fil ($argv)
echo "Extracting data..."
echo -n $fil
grep ^begin $fil | nawk '{print " => "$3}'
nawk '{\
if ($0~"^begin") {print ; goon = 1};\
if ($0~"^end") {print ; exit};\
if (goon == 1) {\
if (($0 !~ "[a-z]") && ((length > 4) && (length < 62))||(length==1)) print}\
}' $fil > $fil.make
echo "Decoding info..."
uudecode $fil.make <---here is where you need to put in your command
echo ""
end