View previous topic :: View next topic
|
Author |
Message |
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
Hi,
I want to FTP multiple PS file to corresponding .txt file. Is there any thing through which i can do so.
I have thought of using mput. But not sure if this would be the correct approach. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
How about giving it a little go and see what happens?
I'm not even sure if you want multiple files on your desktop, or one. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
You should be searching this Forum on similar terms, as you put in your question, there are quite a good number of similar topics around here on this Forum. |
|
Back to top |
|
|
ezio vin
New User
Joined: 16 Aug 2012 Posts: 44 Location: india
|
|
|
|
Using SAS mail you can get the mainframe files as notepad file |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
connect to MF using windows FTP.... then use Mget command to get multiple files from MF to desktop. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Using SAS mail you can get the mainframe files as notepad file |
what if the TS organization does not have SAS
Quote: |
connect to MF using windows FTP.... then use Mget command to get multiple files from MF to desktop. |
a plain mget/mput command will just transfer the files storing them with the same name
the TS question seems to ask on how to append a .txt extension to each one
read the manuals about the use the nmap ftp command
here is the abstract form the unix man page
Quote: |
nmap [inpattern outpattern]
Set or unset the filename mapping mechanism. If no arguments are specified, the filename
mapping mechanism is unset. If arguments are specified, remote filenames are mapped during
mput commands and put commands issued without a specified remote target filename. If argu-
ments are specified, local filenames are mapped during mget commands and get commands
issued without a specified local target filename. This command is useful when connecting
to a non-UNIX remote computer with different file naming conventions or practices. The
mapping follows the pattern set by inpattern and outpattern. [Inpattern] is a template for
incoming filenames (which may have already been processed according to the ntrans and case
settings). Variable templating is accomplished by including the sequences ``$1'', ``$2'',
... ``$9'' in inpattern. Use `\' to prevent this special treatment of the `$' character.
All other characters are treated literally, and are used to determine the nmap [inpattern]
variable values. For example, given inpattern $1.$2 and the remote file name
"mydata.data", $1 would have the value "mydata", and $2 would have the value "data". The
outpattern determines the resulting mapped filename. The sequences ``$1'', ``$2'', ...
``$9'' are replaced by any value resulting from the inpattern template. The sequence
``$0'' is replaced by the original filename. Additionally, the sequence ``[seq1, seq2]''
is replaced by [seq1] if seq1 is not a null string; otherwise it is replaced by seq2. For
example, the command
nmap $1.$2.$3 [$1,$2].[$2,file]
would yield the output filename "myfile.data" for input filenames "myfile.data" and
"myfile.data.old", "myfile.file" for the input filename "myfile", and "myfile.myfile" for
the input filename ".myfile". Spaces may be included in outpattern, as in the example:
nmap $1 sed s/ *$// > $1
Use the `\' character to prevent special treatment of the `$', `[', `]', and `,' charac-
ters.
|
|
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
APPEND...use APPEND instead of PUT.
Make sure to check the file to see if it contains any weird characters between files. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
enrico-sorichetti wrote: |
Quote: |
Using SAS mail you can get the mainframe files as notepad file |
what if the TS organization does not have SAS
Quote: |
connect to MF using windows FTP.... then use Mget command to get multiple files from MF to desktop. |
a plain mget/mput command will just transfer the files storing them with the same name
the TS question seems to ask on how to append a .txt extension to each one
read the manuals about the use the nmap ftp command
here is the abstract form the unix man page
Quote: |
nmap [inpattern outpattern]
Set or unset the filename mapping mechanism. If no arguments are specified, the filename
mapping mechanism is unset. If arguments are specified, remote filenames are mapped during
mput commands and put commands issued without a specified remote target filename. If argu-
ments are specified, local filenames are mapped during mget commands and get commands
issued without a specified local target filename. This command is useful when connecting
to a non-UNIX remote computer with different file naming conventions or practices. The
mapping follows the pattern set by inpattern and outpattern. [Inpattern] is a template for
incoming filenames (which may have already been processed according to the ntrans and case
settings). Variable templating is accomplished by including the sequences ``$1'', ``$2'',
... ``$9'' in inpattern. Use `\' to prevent this special treatment of the `$' character.
All other characters are treated literally, and are used to determine the nmap [inpattern]
variable values. For example, given inpattern $1.$2 and the remote file name
"mydata.data", $1 would have the value "mydata", and $2 would have the value "data". The
outpattern determines the resulting mapped filename. The sequences ``$1'', ``$2'', ...
``$9'' are replaced by any value resulting from the inpattern template. The sequence
``$0'' is replaced by the original filename. Additionally, the sequence ``[seq1, seq2]''
is replaced by [seq1] if seq1 is not a null string; otherwise it is replaced by seq2. For
example, the command
nmap $1.$2.$3 [$1,$2].[$2,file]
would yield the output filename "myfile.data" for input filenames "myfile.data" and
"myfile.data.old", "myfile.file" for the input filename "myfile", and "myfile.myfile" for
the input filename ".myfile". Spaces may be included in outpattern, as in the example:
nmap $1 sed s/ *$// > $1
Use the `\' character to prevent special treatment of the `$', `[', `]', and `,' charac-
ters.
|
|
Once the files are down loaded to desktop we can run a simple batch command to append .txt to all the files
Example
Code: |
for /R %x in (*.*) do ren "%x" *.txt |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Once the files are down loaded to desktop we can run a simple batch command to append .txt to all the files |
did You read carefully the TS question? looks like not...
Quote: |
I have thought of using mput. But not sure if this would be the correct approach.
|
the windoze machine is the destination of the put, most probably a <server> type of machine,
and it would be contrary to any good sense to have any human interaction on it, just to rename some files
and it would also be a very poor approach to have a FTP server running on a desktop
so it is more appropriate to do it all from the FTP <transmitter> side |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
Yeah, I got that wrong. I thought he wanted to put all the mainframe files into a single text file. |
|
Back to top |
|
|
|