Sponsored Content
Special Forums UNIX Desktop Questions & Answers Need to ftp some files, and check the number of rows in the transferd file Post 302492489 by imran_affu on Monday 31st of January 2011 03:51:22 PM
Old 01-31-2011
Hi
Thanks for you early reply,
Actually its SFTP.
here is the script i came up with to ftp and rename the file., i need to add the manifest and email logic to it...

Please find below he script....

Code:
#!/usr/bin/ksh

ftpFrom="/JANUS_IMS_health_Test/MarketRx"
ftpTo="/coe/informatica/v712_OMJ/OMJ_Proherant/SrcFiles"
host="Hostname.com"
user="aimran79"


echo "sftp start"
cd $ftpTo
sftp $user@$host <<EOF
cd /JANUS_IMS_health_Test/MarketRx
mget *.*
bye
EOF

for file in `ls *.csv`
do
 	mv $file `echo "$file" | sed 's/_[^_]*\././'`
done

echo "Program Ended Successfully"


Last edited by pludi; 01-31-2011 at 05:17 PM.. Reason: code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Number Grouped Rows in File

I have a file containing 750,000 records and have managed to sort them by related columns and now i'd like to add an ID number to the front of each line of the records that are grouped together. Which probably makes no sense so i have provided some example data and desired result. Given data.txt... (2 Replies)
Discussion started by: RacerX
2 Replies

2. Shell Programming and Scripting

Splitting file based on number of rows

Hi, I'm, new to shell scripting, I have a requirement where I have to split an incoming file into separate files each containing a maximum of 3 million rows. For e.g: if my incoming file say In.txt has 8 mn rows then I need to create 3 files, in which two will 3 mn rows and one will contain 2... (2 Replies)
Discussion started by: wahi80
2 Replies

3. UNIX for Advanced & Expert Users

Using FTP to check whether file is completely FTP... plz find the description below

Hi, We have some clients who will place huge files in to one of the remote server. And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients. My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies

4. Shell Programming and Scripting

awk number rows from 1 to 3 in file

I have a file with the following format, i need to change de field9 each 3 rows to renumber field9 with gpo1, gpo2, gpo3. I need to use awk Original file field1 field2 field3 field4 field5 field6 field7 field8 gpo3 field1 field2 field3 field4 field5 ... (3 Replies)
Discussion started by: robonet
3 Replies

5. UNIX for Dummies Questions & Answers

How to separate a single column file into files of the same size (i.e. number of rows)?

I have a text file with 1,000,000 rows (It is a single column text file of numbers). I would like to separate the text file into 100 files of equal size (i.e. number of rows). The first file will contain the first 10,000 rows, the second row will contain the second 10,000 rows (rows 10,001-20,000)... (2 Replies)
Discussion started by: evelibertine
2 Replies

6. UNIX for Dummies Questions & Answers

Merge two files with common IDs but unequal number of rows

Hi, I have two files that I would like to merge and think that there should be a solution using awk. The files look something like this: file 1 IDX1 IDY1 IDX2 IDY2 IDX3 IDY3 file 2 IDY1 dataA data1 IDY2 dataB data2 IDY3 dataC data3 Desired output IDX1 IDY1 dataA data1 IDX2 ... (5 Replies)
Discussion started by: katie8856
5 Replies

7. UNIX for Dummies Questions & Answers

Write the total number of rows in multiple files into another file

Hello Friends, I know you all are busy and inteligent too... I am stuck with one small issue if you can help me then it will be really great. My problem is I am having some files i.e. Input.txt1 Input.txt2 Input.txt3 Now my task is I need to check the total number of rows in... (4 Replies)
Discussion started by: malaya kumar
4 Replies

8. Shell Programming and Scripting

How to check whether files are transferred or not using ftp?

Hi, i want to execute a shell script which transfers files from one server to another using ftp in unix. How can i check whether the ftp is successful or not.(i.e files are transferred to destination server). because if i am checking the return code of ftp, it always shows 0 (denoting ftp is... (5 Replies)
Discussion started by: Little
5 Replies

9. Shell Programming and Scripting

Split File based on number of rows

Hi I have a requirement, where i will receive multiple files in a folder (say: /fol1/fol2/). There will be at least 14 to 16 files. The size of the files will different, some may be 80GB or 90GB, some may be less than 5 GB (and the size of the files are very unpredictable). But the names of the... (10 Replies)
Discussion started by: kpk_ds
10 Replies

10. UNIX for Beginners Questions & Answers

How to check if any files are being FTP'ed currently ?

how to check if any files are being FTP'ed currently ? both FTP in and FTP out. And is there any system log for all the FTP activities ? (2 Replies)
Discussion started by: i4ismail
2 Replies
XkbAddGeomOverlay(3)						   XKB FUNCTIONS					      XkbAddGeomOverlay(3)

NAME
XkbAddGeomOverlay - Add one overlay to a section SYNOPSIS
XkbOverlayPtr XkbAddGeomOverlay (XkbSectionPtr section, Atom name, int sz_rows); ARGUMENTS
- section section to which an overlay will be added - name name of the overlay - sz_rows number of rows to reserve in the overlay DESCRIPTION
Xkb provides functions to add a single new element to the top-level keyboard geometry. In each case the num_ * fields of the corresponding structure is incremented by 1. These functions do not change sz_* unless there is no more room in the array. Some of these functions fill in the values of the element's structure from the arguments. For other functions, you must explicitly write code to fill the structure's elements. The top-level geometry description includes a list of geometry properties. A geometry property associates an arbitrary string with an equally arbitrary name. Programs that display images of keyboards can use geometry properties as hints, but they are not interpreted by Xkb. No other geometry structures refer to geometry properties. XkbAddGeomOverlay adds an overlay with the specified name to the specified section. The new overlay is created with space allocated for sz_rows rows. If an overlay with name name already exists in the section, a pointer to the existing overlay is returned. XkbAddGeomOverlay returns NULL if any of the parameters is empty or if it was not able to allocate space for the overlay. To allocate space for an arbitrary number of overlays to a section, use the XkbAllocGeomOverlay function. STRUCTURES
typedef struct _XkbOverlayRec { Atom name; /* overlay name */ XkbSectionPtr section_under; /* the section under this overlay */ unsigned short num_rows; /* number of rows in the rows array */ unsigned short sz_rows; /* size of the rows array */ XkbOverlayRowPtr rows; /* array of rows in the overlay */ XkbBoundsPtr bounds; /* bounding box for the overlay */ } XkbOverlayRec,*XkbOverlayPtr; SEE ALSO
XkbAllocGeomOverlay(3) X Version 11 libX11 1.3.2 XkbAddGeomOverlay(3)
All times are GMT -4. The time now is 04:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy