I am having a file(1234.txt) downloaded from windows server (in Ascii format).However when i ftp this file to Unix server and try to work with it..i am unable to do anything.When i try to open the file using vi editor the file opens in the following format ...
@
@
@
@
@
@
@
@
"1234.txt" 1 line, 73232 characters
I believe the whole file is being treated as a single line.
when i view the file using more command...the following is the output...where i could see the end-of-line charaters(^M) similar to binary file opened in vi editor.
more 1234.txt
00:06:00 CARD TAKEN^M 00:06:01 TRANSACTION END^M*901*05/05/2010*00:45*^M *TRANSACTION START*^M CARD INSERTED^MCARD: *****************^MDATE 05-05-10 TIME 00:45:11^M 00:4
5:22 PIN ENTERED^M*902*05/05/2010*00:45*^M *9561*1*w*0, M-00, R-0
The same file if i open using wordpad or ultraedit in windows,the following is the output (the correct format)
00:06:00 CARD TAKEN
00:06:01 TRANSACTION END
*901*05/05/2010*00:45*
*TRANSACTION START*
CARD INSERTED
CARD: *****************
DATE 05-05-10 TIME 00:45:11
00:45:22 PIN ENTERED
*902*05/05/2010*00:45*
*9561*1*w*0, M-00, R-0
I am not sure where i am making mistake.
I tried FTP in ASCII as well as binary format and i tried the following awk command as suggested by Franklin 52 in one of the similar post earlier
awk '{printf "%s\r\n", $0}' 1234.txt >> 1234.txt1
still i am not getting the output in unix similar to wordpad/ultra edit.