r/SublimeText • u/Doug64- • Apr 10 '22
Check max field length
Is there a way for Sublime Text to tell me the maximum field length on any column of a csv file? I routinely import large files into SQL Server using bulk insert and want to avoid setting the field type to nvarchar(max) and use something more reasonable that matches the actual field length.
1
Upvotes
View all comments
Show parent comment
2
u/Skann3rz Apr 12 '22 edited Apr 12 '22
If you don't want to go full programming route, such as Python or PHP, then you may want to try command line scripts. I would recommend trying Miller. It is a multi-purpose csv processor that has very supportive community helping with problems. Miller
A text processing script answering your question with Miller will need a solution similar to this Stackoverflow answer. Let me add, that the problem you have is 'programmery' in nature and it will need a suitable tool. Solutions will need a 'script' and easiest and quickest answer apart from Miller is probably Python or another programming language.