Generate and copy files in UNICODE format from Linux to Windows


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Generate and copy files in UNICODE format from Linux to Windows
# 1  
Old 12-29-2011
Generate and copy files in UNICODE format from Linux to Windows

Hi,We have an interface which extracts data from database tables, spool the records into text files, and copy those files using SFTP to a windows server location. The target system loads these files into its database using some DTS packages in SQL Server.

This interface of exporting text files is being implemented using a shell script.


The problem we are facing is with the format of the file. The file should be in UNICODE format as per the target system requirement. Also, the line endings of each line in the text is not proper when it is opened in windows machine.

The records did not get loaded as they are not separated by Newline character. As there is no new line character, all records are being assumed as one and only first record is getting loaded into the database.Also, the files need to be in UNICODE format.

Please let me know what specific commands/settings needs to be done in the shell script to make sure the files are generated in UNICODE and transferred properly which can be used in the windows server machine.

Thanks a lot for your help.

Last edited by urjagadeesh; 12-29-2011 at 03:02 AM.. Reason: corrections, formatting
# 2  
Old 12-29-2011
use unix2dos or ux2dos before sftp the files. look at the man pages for details.

Please note, the availability of these programs varies with the OS. unix2dos works on Solaris/Linux while ux2dos works on HP-UX and AIX
# 3  
Old 12-29-2011
Hi,
Thanks for the information.

Can you please provide any sample script how to use unix2dos program?
# 4  
Old 12-29-2011
Again, You need to check man page.
the usage are not same for all OS.

I am on HP-UX machine. It writes to the STDOUT

Code:
ux2dos file > newfile

use newfile for further processing (SFTP)

on linux, I remember, unix2dos file saves the changes in file.
# 5  
Old 12-30-2011
Hi,
I have used unix2dos to convert the files to use proper line endings. However still the file format shows as ASCII text. I have used file <filename> command to check this.
Can you please help me in converting the files to UNICODE format?
Thanks
# 6  
Old 01-02-2012
Hi,
Can anyone help with the fixing above issue?
# 7  
Old 01-02-2012
Are you sure you are using text mode in sftp and not binary mode?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Modified or latest files copy from windows to Linux

To copy the file from windows to linux i use pscp command(pscp source user@destination). Know i want to copy the latest modified or created files from windows to linux. could any one please help me out with it. Thanks and Regards, Sourabh (2 Replies)
Discussion started by: SourabhChavan
2 Replies

2. Solaris

Need to copy files to Windows from Solaris - sun os 5.6

Hi All, I am supposed to copy files from Solaris to windows on Daily Basis. Have tried using with scp and have error "connection refused" The version is sun os - 5.6 Have checked using ps -ef | grep sshd to find whether the ssh service is running. and i dont find any service... (3 Replies)
Discussion started by: vijaymec50
3 Replies

3. UNIX for Dummies Questions & Answers

Copy files from Linux server local windows machine using a shell script

Hello, I need to create a shell script which will copy files - which are created on particular date and starting with particular name - to local windows XP machine. Is this possible.? Currently it is being done manually using winscp (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies

4. Shell Programming and Scripting

Copy files from Linux server to Windows server

Hi All, I am generating report in a Linux server and once the report is generated the report(.txt file) needs to be automatically saved in a Windows servers. So i am looking for a script to transfer the file automatically from Linux server to Windows server? Please advise. Thanks... (3 Replies)
Discussion started by: arunmanas
3 Replies

5. UNIX for Dummies Questions & Answers

Copy everything from remote Linux to external hard drive in windows

Hi, I`m trying to copy an entire directory(with numerous files, folders and subfolders etc, a content size of 500gigs) from a linux machine running Red Hat Enterprise Linux 6 to an external hard drive on my windows. I downloaded and installed psftp on my windows and I can login using psftp... (9 Replies)
Discussion started by: newbie83
9 Replies

6. Shell Programming and Scripting

copy files from linux to windows

is there any way to copy files from linux to windoes with out mounting ideally using a script in linux or windows which ever possible (4 Replies)
Discussion started by: robo
4 Replies

7. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

8. Shell Programming and Scripting

shell script to copy files frm a linux machine to a windows machine using SCP

I need a shell script to copy files frm a linux machine to a windows machine using SCP. The files keeps changing day-to-day. I have to copy the latest file to the windows machine frm the linux machine. for example :In Linux, On July 20, the file name will be 20.txt and it should be copied to... (3 Replies)
Discussion started by: nithin6034
3 Replies

9. UNIX for Dummies Questions & Answers

Copy directory from Linux to Windows

Hola a todos, soy realmente nuevo programando en bash, y aśn estoy encontrando bastantes baches :o, mi pregunta es simple, supongo, alguien podria decirme si existe una manera facil de copiar un directorio de un server a otro?, sucede que en un server(server1) tengo los backup de las bases de... (7 Replies)
Discussion started by: yeestrada
7 Replies

10. UNIX for Advanced & Expert Users

how can i copy data in LINUX Machine to windows XP

Can anyone tell me how can i copy data in LINUX Machine to windows XP Thanks, Sandeep (2 Replies)
Discussion started by: bsandeep_80
2 Replies
Login or Register to Ask a Question