LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-21-2013, 12:58 PM   #1
sdorich
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Rep: Reputation: Disabled
ASCII text with very long lines with CRLF line terminators


So I'm trying to load data from a csv file into a db. The documentation for the db says that the db expects all files being loaded is in the Unicode UTF-8 format. I checked my file format and I got that it's "ASCII text with very long lines with CRLF line terminators". The db says it's fine with ASCII text since it's UTF-8 compatible. But for some reason I'm having issues. So I'm wondering if it's b/c of the "with very long lines with CRLF line terminators" or if it's something totally different. If it does have to do with CRLF line terminators, how can I fix this in Linux?
 
Old 11-21-2013, 01:05 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
maybe ? what db system is this (mysql ?). what issues are you having (what are the error messages).

did you create the file in windows or something. is it possible to create the file on linux to avoid the possibility of crlf's . theres a program dos2unix which sometimes helps with this kind of thing.

Last edited by schneidz; 11-21-2013 at 01:07 PM.
 
Old 11-21-2013, 01:17 PM   #3
sdorich
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
HP Vertica is the db system and it's telling me that the file cannot be found but I'm in the correct directory and checked my spelling multiple times so I'm confused. It did give me a hint saying if using the ON ANY NODE option I needed to put the data file in same location on each node (although I'm not specifying this option, I did try putting the data file in the same location on each node of my cluster). So right now I'm kind of at a dead end and am hoping someone may be able to help me troubleshoot this issue.

I downloaded the file I wanted to load online (it's like over 1000 rows so I wouldn't want to create it from scratch in Linux). Oh and this file was originally an Excel file (I just converted it to .csv). I'll look into the dos2unix program and see if that'll help.

Thanks

Last edited by sdorich; 11-21-2013 at 01:19 PM.
 
Old 11-21-2013, 03:30 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Exactly how are you directing the database to load the file?

One system I'm familiar with, you give the database system the file to load... But you can't give it a relative name - it must be the complete path or the database will not be able to find it. That is because the database engine doesn't have the same context as the user interface.
 
1 members found this post helpful.
Old 11-21-2013, 04:25 PM   #5
sdorich
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
thanks!

@jpollard - Thanks! Using the complete path worked - I feel dumb for not trying that before.
 
Old 11-21-2013, 05:33 PM   #6
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by sdorich View Post
@jpollard - Thanks! Using the complete path worked - I feel dumb for not trying that before.
for future reference you should copy-paste the command you use as well as any error that is reported so that people can identify things that are obvious.
 
  


Reply



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
[SOLVED] Text to ASCII art command line tool qweasd Linux - General 2 10-24-2010 04:14 PM
[SOLVED] Removing line terminators from a plain text file. stf92 Linux - Software 11 07-31-2010 07:05 AM
How to remove CRLF, CR line terminators keshavk Linux - Newbie 2 08-02-2009 12:56 PM
print a text file with long lines and line number added powah Linux - General 2 05-26-2006 02:02 PM

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

All times are GMT -5. The time now is 02:55 PM.

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