LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-05-2019, 01:53 PM   #61
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946

Quote:
Originally Posted by satyarankireddy View Post
See the my output:-

for input in /test/test_file.xls; do unoconv -f csv -e FilterOptions="59,34,1,0" --stdout $input | tail -n +6; done > /test/model.csv

MY CSV format as Encoding 1252 (ANSI - Latin l)

output the same as above.

"Killos";"water";83.33;83.33
"Killos";"gas";100;100

After changing column type as text in .xls tile then output like below.

"Killos";"water";83.3333358764648;83.3333358764648
"Killos";"gas";100;100

I have tried to save EXecl format as UTF-8 as well. Output the same as above.

As per document I have tried all the character sets as follows but output the same as above. nothing changing.

Character Set Index
Windows-1250/WinLatin 2 (Central European) 33
Windows-1252/WinLatin 1 (Western) 1

Commands are as follow:

for input in /test/test_file.xls; do unoconv -f csv -e FilterOptions="59,34,1,0" --stdout $input | tail -n +6; done > /test/model.csv

for input in /test/test_file.xls; do unoconv -f csv -e FilterOptions="59,34,33,0" --stdout $input | tail -n +6; done > /test/model.csv

I was wondering how you are getting the right values? I am sorry guys keep on asking help. I tried my best but somehow I was missing something. I couldn't identify that.
Note: - You all are tried to help but no luck from the side. This is the last attempt on this thread if not able to get it then we can close this thread.
You're still not paying attention.

AGAIN: **WHY** can you not use sed or tr to simply replace the "." with "," in your output file, after you generate it???
AGAIN: I used your sample data, and had no problems.
AGAIN: What is the number format set to in the Excel spreadsheet???

If you're not going to answer, there isn't much point in posting.
 
Old 11-05-2019, 11:31 PM   #62
satyarankireddy
Member
 
Registered: Mar 2019
Posts: 48

Original Poster
Rep: Reputation: Disabled
AGAIN: **WHY** can you not use sed or tr to simply replace the "." with "," in your output file, after you generate it???
Can you please leave me the exact syntax will try it once. I mean we have to apply on the entire CSV file?

sed '/[0-9]\./s/\./,/g'

AGAIN: I used your sample data, and had no problems.

Ya, I was wonder how it is working for you?

AGAIN: What is the number format set to in the Excel spreadsheet???
It number format in excel spreadsheet. I tried to change text format in excel both outputs are the same.
 
Old 11-06-2019, 06:46 AM   #63
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by satyarankireddy View Post
AGAIN: **WHY** can you not use sed or tr to simply replace the "." with "," in your output file, after you generate it???
Can you please leave me the exact syntax will try it once. I mean we have to apply on the entire CSV file?
sed '/[0-9]\./s/\./,/g'
No, sorry...after five pages and two threads, it is time you actually try to show your own effort. There are *THOUSANDS* of examples of both sed and tr being used to replace things in files, and their man pages tell you how as well. YOU, PERSONALLY, need to show some effort on your own project. Want to change a whole file? Look at the "-i" option for sed. And are you actually thinking about what you're doing with the sed statement above and what you're feeding into it??? You only want to replace the dots...so why are you putting a regex for numbers? There are NO OTHER PERIODS in the file, other than those in the number field.
Quote:
AGAIN: I used your sample data, and had no problems.
Ya, I was wonder how it is working for you?
Because, **AGAIN**, I checked the Excel file number format.
Quote:
AGAIN: What is the number format set to in the Excel spreadsheet???
It number format in excel spreadsheet. I tried to change text format in excel both outputs are the same.
Hard to believe that, since it worked for me.
 
Old 11-06-2019, 11:52 PM   #64
satyarankireddy
Member
 
Registered: Mar 2019
Posts: 48

Original Poster
Rep: Reputation: Disabled
Thumbs up

Thanks for your response and for providing hints to solve this issue. We have applied awk command to replace "." to "," and it is working fine. Thank you again for your wonderful support. I marked as solved this thread.
 
Old 11-07-2019, 09:49 AM   #65
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,877
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by satyarankireddy View Post
Thanks for your response and for providing hints to solve this issue. We have applied awk command to replace "." to "," and it is working fine. Thank you again for your wonderful support. I marked as solved this thread.
What would be helpful for reference is if you over-viewed the awk commands you used to solve your problem.
 
1 members found this post helpful.
  


Reply

Tags
linux


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to convert xls file to csv file in Linux and vice versa LXer Syndicated Linux News 0 05-05-2017 11:27 AM
LXer: How to convert xls file to csv file in Linux and vice versa LXer Syndicated Linux News 0 05-05-2017 09:06 AM
Convert xls to csv using php ajeesh.tr Programming 1 04-26-2011 07:14 PM
Perl convert csv to xls hawk__0 Programming 3 09-16-2009 09:13 AM
Script to convert csv 2 xls or odt xowl Linux - Software 1 01-16-2007 09:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration