[SOLVED] Mutipule .xls files convert into single .csv
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.