Hi,
I have a text file like
----------------------
aaa|bbb|ccc|ddd|eee
fff|gggg|hhhhhh|kkkk
--------------------
I have a script which will transfer(thourgh FTP) this text file to windows system.
But I want to covert it into excel or CSF then upload into windows system..
thanks
csv? you can convert those "|" into ","
sed -i 's/|/,/g' file
reborg
April 14, 2007, 9:13am
3
most seds do not have a -i option, so if that is your case:
tr '|' ',' < file > newfile
upload newfile
or
sed 's/|/,/g' file > newfile
upload newfile
or
perl -pi -e 's/|/,/g' file
upload file
Cool..
I got it..
uploading it .csv format to window system, when i open the file it is giving desired format....
Thanks
srikanthus2002:
Hi,
I have a text file like
----------------------
aaa|bbb|ccc|ddd|eee
fff|gggg|hhhhhh|kkkk
--------------------
I have a script which will transfer(thourgh FTP) this text file to windows system.
But I want to covert it into excel or CSF then upload into windows system..
[INDENT]
Excel can use any character as a delimiter.
Import that file, as it is, and tell Excel to use the pipe as the delimiter.
Hi John,
good question,
But I have to give a file to client in excel format...( Client don't want to do import stufft as you said)
I think, this would creare your doubt...
perl -pi -e 's/|/\t/g' filename
save the file with .xls extension. a tab separated file will be treated well by excel
could you please share the script if there is any script that delivers the output through FTP onto windows.....
i have a windows ftp server...i.p 10.229.249.210
i am using a script (ftp section )
ftp -n 10.229.249.210 < !# you can give host name if entry is available in /etc/hosts file.
user user_name
password pass_word
cd /home/kanth
put test.txt # file name which you want to transer
bye
!
you can get lot of scripts in this forum just search ....
srikanthus2002:
i have a windows ftp server...i.p 10.229.249.210
i am using a script (ftp section )
ftp -n 10.229.249.210 < !# you can give host name if entry is available in /etc/hosts file.
That should be <<, not <, and there must be a space after !.
You can give the host name whether it is in /etc/hosts or not. That's what DNS is for.