今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Parsing Excel CSV files: line endings and quoting - Linux教程
课程: AWK Essential Training
Parsing Excel CSV files: line endings and quoting
- Now we come to the elephant in the room, using awk to read CSV files produced by Microsoft Excel. This is a very common awk task, and harder than it looks. By now, I'm sure you understand that awk can't understand Excel's binary dot xls or dot xlsx format, but you probably think, the comma-separated value, or CSV format, is a delimited text file. If I have data in Excel, and want to do some work on it using awk, I can just save it from Excel as a CSV, and awk should have no trouble with it, right? Unfortunately, the CSV format isn't quite as simple or as consistent as you might hope. Here's a little Excel file, which I've constructed to include some of the types of data that can cause problems with CSV files. Let's save it as a CSV. We'll select comma-separated values from the dropdown, and specify dot CSV for the file name. Yes, we really want to do this. Now let's try printing out the three fields on each…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。