Comments (7)
Are you trying to parse the same csv file?
My first guess would be that the End Of Line character is different.
Try the FirstOccurenceSettingsDetector
:
var d = new FirstOccurrenceSettingsDetector(eols: ['\r\n', '\n']);
String codetxt = await rootBundle.loadString('assets/file.csv');
List<List<dynamic>> codeList = CsvToListConverter(csvSettingsDetector: d).convert(codetxt);
print('codelist size ' + codeList.length.toString());
from csv.
This problem started after upgrading flutter. One has to specify this way explicitly.
On my side, it worked well before the update, but after going to flutter 1.9.1 from flutter 1.7.8, i had to explicitly specify var d = new FirstOccurrenceSettingsDetector(eols: ['\r\n', '\n']);
Are you trying to parse the same csv file?
My first guess would be that the End Of Line character is different.
Try the
FirstOccurenceSettingsDetector
:var d = new FirstOccurrenceSettingsDetector(eols: ['\r\n', '\n']); String codetxt = await rootBundle.loadString('assets/file.csv'); List<List<dynamic>> codeList = CsvToListConverter(csvSettingsDetector: d).convert(codetxt); print('codelist size ' + codeList.length.toString());
from csv.
I had to import a specific file from the csv-library in order to access FirstOccurenceSettingsDetector:
import 'package:csv/csv_settings_autodetection.dart' as csvAuto;
var d = new csvAuto.FirstOccurrenceSettingsDetector(eols: ['\r\n', '\n']);
from csv.
Yes, it's the same file, but your suggestion worked. Thanks!
I'm compiling Android on Windows and iOS on Mac. The file has \r\n line endings, but maybe mac is ignoring the \r which was causing the problem?
PS Thanks so much for this package. CSV is 600k, equivalent json is over 2Mb and slow to load on iOS.
from csv.
Are you trying to parse the same csv file?
My first guess would be that the End Of Line character is different.
Try the
FirstOccurenceSettingsDetector
:var d = new FirstOccurrenceSettingsDetector(eols: ['\r\n', '\n']); String codetxt = await rootBundle.loadString('assets/file.csv'); List<List<dynamic>> codeList = CsvToListConverter(csvSettingsDetector: d).convert(codetxt); print('codelist size ' + codeList.length.toString());
Thank you, it worked for me too. Flutter version 1.20.1
and csv: ^4.0.3
from csv.
I ran the code on my Windows PC giving my Android virtual and real device a working file, but when deployed via Play Store it didn't work. This finally made me realize it's just a compiletime issue. My app is built on a Linux device.
This issue should be closed, as it is not really an issue :)
from csv.
Thanks for the feedback!
from csv.
Related Issues (20)
- Can't find the generated file HOT 1
- Create sheet HOT 2
- utf-8 support? HOT 1
- Safari issue in exported csv HOT 4
- CsvToListConverter return all the row data in single entry HOT 3
- [bug] `CsvToListConverter` does not split last row element from the first element of the next row. HOT 1
- The numbers or time contain "\" HOT 2
- Different output in debug and when deployed HOT 1
- EOL error HOT 1
- Multi Sheets per file ? HOT 1
- How to make each fields data to be enclosed with double quotes. HOT 1
- Mime type HOT 3
- Escaping HOT 1
- Delimiter for decimal HOT 2
- Unexpected Error: The text end delimiter (") for the last field is missing. HOT 2
- [DocumentManager] The view service did terminate with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method} HOT 1
- Issue compatibility with Flutter 3.10.x HOT 3
- Warning in cvs-5.1.0 HOT 1
- No support sep paramter
- svToListConverter().convert doesn`t work on IOS (works on android)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csv.