12-21-2022, 05:10 AM
Using python script component.
Paste below script in meta information script section.
Provide connection credentials.
import pandas as pd
import paramiko
def myconnect():
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('localhost',port=22,username='user',password='123456')
#print("connected suceessfully to SFTP Server")
sftp_client = ssh.open_sftp()
sftp_client.chdir('/home/user/folder_name')
df= pd.read_csv(sftp_client.open('/home/user/folder_name/file_name.csv'))
sftp_client.close()
ssh.close()
return df
Paste below script in meta information script section.
Provide connection credentials.
import pandas as pd
import paramiko
def myconnect():
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('localhost',port=22,username='user',password='123456')
#print("connected suceessfully to SFTP Server")
sftp_client = ssh.open_sftp()
sftp_client.chdir('/home/user/folder_name')
df= pd.read_csv(sftp_client.open('/home/user/folder_name/file_name.csv'))
sftp_client.close()
ssh.close()
return df