Script to delete all data from multiple files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to delete all data from multiple files
# 1  
Old 03-28-2006
Java Script to delete all data from multiple files

its urgent!!!!!!111

i need a script which can delete data from multiple files.

plz if anybody knows the script plz write a mail to me :
(Email addresses are not allowed)

Last edited by RTM; 03-28-2006 at 11:25 AM..
# 2  
Old 03-28-2006
See number 10
# 3  
Old 03-28-2006
hi
do one thing.

select files - [multiple files] in loop.
delete same file. -
and create new file of same name - in same path.

Regards,
Swapneel
# 4  
Old 03-28-2006
Quote:
Originally Posted by d_swapneel14
hi
do one thing.

select files - [multiple files] in loop.
delete same file. -
and create new file of same name - in same path.

Regards,
Swapneel
and how will this really accomplish the OP task?
could you elaborate, pls!
# 5  
Old 03-29-2006
hi vgersh99,

give me some time. i will try to do this
franklly i m new baby to unix and linux so to find commands i need some time.
i will revert u back asap

regards,
swapneel
# 6  
Old 03-29-2006
ureka

Hi all,

echo " in loop"
for f in *.a
do
rm $f
cat/dev/null > $f
echo $f
done


here you canreplace *.a to *.*.. simple

Thank You.
Best Regards,
Swapneel
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

In PErl script: need to read the data one file and generate multiple files based on the data

We have the data looks like below in a log file. I want to generat files based on the string between two hash(#) symbol like below Source: #ext1#test1.tale2 drop #ext1#test11.tale21 drop #ext1#test123.tale21 drop #ext2#test1.tale21 drop #ext2#test12.tale21 drop #ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies

2. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies

3. UNIX for Dummies Questions & Answers

How To Delete Multiple Files At Once?

I Want to delete the following files together,what command should i pass for that? (Note:- All Start With .) .bash_logout .bashrc .bash_profile .rtorrent.rc ... (3 Replies)
Discussion started by: anime12345
3 Replies

4. Shell Programming and Scripting

Bash script with python slicing on multiple data files

I have 2 files generated in linux that has common output and were produced across multiple hosts with the same setup/configs. These files do some simple reporting on resource allocation and user sessions. So, essentially, say, 10 hosts, with the same (2) system reporting in the files, so a... (0 Replies)
Discussion started by: jdubbz
0 Replies

5. Shell Programming and Scripting

Script to delete files older than x days and also taking an input for multiple paths

Hi , I am a newbie!!! I want to develop a script for deleting files older than x days from multiple paths. Now I could reach upto this piece of code which deletes files older than x days from a particular path. How do I enhance it to have an input from a .txt file or a .dat file? For eg:... (12 Replies)
Discussion started by: jhilmil
12 Replies

6. Shell Programming and Scripting

Shell Script to delete files within a particular time frame under multiple sub folders

Greetings! I'm looking for starting information for a shell script. Here's my scenario: I have multiple folders(100) for example: /www/test/applications/app1/logs /www/test/applications/app2/logs Within these folders there are log files files that need to be deleted after a month. ... (3 Replies)
Discussion started by: whysolucky
3 Replies

7. Shell Programming and Scripting

script to delete multiple files in remote machine

Requirement Several files in remote machines ought to be deleted via sh. Name of the files to be deleted are know Approach 1) script was written with ftp (requires credential) and delete command. File names were passed as array(iterated via for loop-with ftp+delete commands enclosed within... (1 Reply)
Discussion started by: vkalya
1 Replies

8. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

9. UNIX for Dummies Questions & Answers

Need a script to delete multiple files

Hello, I am working with about 500,000 text files and 90% of them are duplicates. I need a way to delete the duplicate ones. The files are email messages with the following file name examples: 20040129-1457 This is the Subject line.txt 20040129-1457 This is the Subject line-1.txt... (3 Replies)
Discussion started by: navycow
3 Replies

10. UNIX for Dummies Questions & Answers

when I try to run rm on multiple files I have problem to delete files with space

Hello when I try to run rm on multiple files I have problem to delete files with space. I have this command : find . -name "*.cmd" | xargs \rm -f it doing the work fine but when it comes across files with spaces like : "my foo file.cmd" it refuse to delete it why? (1 Reply)
Discussion started by: umen
1 Replies
Login or Register to Ask a Question