New file should store all the 7 existing filenames and their record counts and ftp th


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting New file should store all the 7 existing filenames and their record counts and ftp th
# 1  
Old 11-24-2011
New file should store all the 7 existing filenames and their record counts and ftp th

Hi,

I need help regarding below concern.

There is a script and it has 7 existing files(in a path say,. usr/appl/temp/file1.txt) and I need to create one new blank file say “file_count.txt” in the same script itself.

Then the new file <file_count.txt> should store all the 7 filenames and their record counts and ftp them to one server.

Content of New file <file_record_count.txt> should be like this below..
Code:
File1 <actual_record_count>
File2 <actual_record_count>
File3 <actual_record_count>
File4 <actual_record_count>
File5 <actual_record_count>
File6 <actual_record_count>
File7 <actual_record_count>

Thanks in advance!!!!

Regards,
Pr....


Moderator's Comments:
Mod Comment How to use code tags

Last edited by Franklin52; 11-24-2011 at 03:44 AM.. Reason: Please use code tags for code and data samples, thank you
# 2  
Old 11-24-2011
Code:
$ wc -l File[1-7] | sed '$d' > file_count.txt 

Then include the ftp code to transfer this file ..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove duplicated records and update last line record counts

Hi Gurus, I need to remove duplicate line in file and update TRAILER (last line) record count. the file is comma delimited, field 2 is key to identify duplicated record. I can use below command to remove duplicated. but don't know how to replace last line 2nd field to new count. awk -F","... (11 Replies)
Discussion started by: green_k
11 Replies

2. Shell Programming and Scripting

Store filenames for wget in bash

I have a bash that downloads a list of files as a text file using wget. What I now need to do is store those files names and pass them to a download call also using wget. List.txt in /home directory FilterDuplicates.html file1.bam file2.bam file3.bam file1.vcf.gz file2.vcf.gz... (3 Replies)
Discussion started by: cmccabe
3 Replies

3. Shell Programming and Scripting

How to take the filenames from a directory and store into a file??

hi, how can i take the file names from a directory and store only the filenames in the file. suppose i have a directory which contains the following files and subdirectories. $ ls -ltr total 16 -rw-rw-r-- 1 adm etc 4 Aug 6 20:37 s1.txt -rw-rw-r-- 1 adm etc 4 Aug 6 20:37 s2.txt... (11 Replies)
Discussion started by: Little
11 Replies

4. Shell Programming and Scripting

How to store results of ls in ftp?

Hi, I want to store the results of running ls in a directory on a remote host using ftp. For example, #!/usr/bin/ksh ftp -n hostx <<EOF user username password ls /tmp/RandomFiles.* #I need to put the results of that ls command into some file, so I can get the last file in... (3 Replies)
Discussion started by: mrskittles99
3 Replies

5. UNIX for Dummies Questions & Answers

Hardcoding & Record counts in a file

HI , I am having a huge comma delimiter file, I have to append the following four lines before the starting of the file through a shell script. FILE NAME = TEST_LOAD DATETIME = CURRENT DATE TIME LOAD DATE = CURRENT DATE RECORD COUNT = TOTAL RECORDS IN FILE Source data 1,2,3,4,5,6,7... (7 Replies)
Discussion started by: shruthidwh
7 Replies

6. Shell Programming and Scripting

Sending e-mail of record counts in 3 or more files

I am trying to load data into 3 tables simultaneously (which is working fine). Then when loaded, it should count the total number of records in all the 3 input files and send an e-mail to the user. The script is working fine, as far as loading all the 3 input files into the database tables, but... (3 Replies)
Discussion started by: msrahman
3 Replies

7. Shell Programming and Scripting

Giving existing user access on ftp

Hi all, I have a project on going that combines two different departments. I cannot give detais on this project, I´m sure everybody understands that, but I would like your help on giving me pointers on how to give an existing user access to ftp, without the need to give him full access. So here... (0 Replies)
Discussion started by: Alexis Duarte
0 Replies

8. Shell Programming and Scripting

folder existing and file existing

I want to look into a folder to see if there are any folders within it. If there are, I need to check inside each folder to see if it contains a .pdf file So If /myserver/myfolder/ contains a folder AND that folder conatins a .pdf file do X Else do Z I may have multiple folders and... (4 Replies)
Discussion started by: crowman
4 Replies

9. Shell Programming and Scripting

FTP'ing files with filenames in mail messege

Hi, I have created the following FTP script, which transfers daily “.txt” files from remote server in to a timestamped folder on local server. Once all files are FTP'ed, it then deletes files from remote server. When files are FTP'ed, I get a mail messege like, “Files are successfully transfered”,... (1 Reply)
Discussion started by: berlin_germany
1 Replies

10. Filesystems, Disks and Memory

existing non-floppy, non-cd ftp install?

I have downloaded the needed files to make a ftp install. The files are suposed to be put on a floppy disk. However, the files are, appearantly, too big for any of my 1.44mb disks. I have formated them. And so, I wanted to know, can I install without having to use cd or floppy, but also without... (1 Reply)
Discussion started by: G-wizz
1 Replies
Login or Register to Ask a Question