Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT Text(CSV)
Problem with line feed: Reading text file on Linux
James Frankman
2006-12-19 07:01:31.0
I am writing an applicaiton that uses Hibernate and the HXTT text driver to read a text file. The applicaiton works on windows, but when I run in on linux, it reads the first line ok, but when it reads the second line it is off by one character. I think it something to do with windows using "\r\n" to mark the end of the line, and linux only uses "\n". Is there a system property I should set so that the HXTT driver properly reads text files on Linux?
Re:Problem with line feed: Reading text file on Linux
HXTT Support
2006-12-19 07:18:39.0
What's your table defination sql for create table?
Re:Re:Problem with line feed: Reading text file on Linux
james frankman
2006-12-19 07:29:36.0
create table if not exists indexDetail (
ACCOUNTNO varchar(15),
BLANK1 varchar(1),
CAPTUREDATE varchar(6),
BLANK2 varchar(1),
SEQUENCENO varchar(12),
BLANK3 varchar(1),
INTERNALUSE1 varchar(98),
BLANK4 varchar(1),
AVAILABILITYCODE varchar(1),
BLANK5 varchar(1),
IMAGESTARTINGLOCATION varchar(18),
BLANK6 varchar(1),
IMAGELENGTH varchar(9),
BLANK7 varchar(1),
FRONTBACKINDICATOR varchar(1),
AMOUNT varchar(10),
SERIAL varchar(10),
INTERNALUSE2 varchar(17),
ROUTINGTRANSIT varchar(9),
AMOUNT2 varchar(10),
CHECKNUMBER varchar(15),
POSTEDDATE varchar(8),
INTERNALUSE3 varchar(15),
CORRECTIONINDICATOR varchar(1),
Blanks varchar(338),
_StuffedColumn char(2) default '\r\n'
);
Re:Re:Re:Problem with line feed: Reading text file on Linux
2006-12-19 07:31:48.0
>_StuffedColumn char(2) default '\r\n'
Changed it to _StuffedColumn char(1) default '\n'

Re:Re:Re:Re:Problem with line feed: Reading text file on Linux
james frankman
2006-12-19 07:37:04.0
The problem with that is that my code will no longer be portable. I will need to change the schema if I move to another platform. Instead, could I set the System property:

System.setProperty("line.separator", "\r\n");

This way I could move the code from platform to platform. Will this cause any problems since Linux only uses "\n" instead of "\r\n"?
Re:Re:Problem with line feed: Reading text file on Linux
james frankman
2006-12-19 10:03:59.0
create table if not exists indexDetail (
ACCOUNTNO varchar(15),
BLANK1 varchar(1),
CAPTUREDATE varchar(6),
BLANK2 varchar(1),
SEQUENCENO varchar(12),
BLANK3 varchar(1),
INTERNALUSE1 varchar(98),
BLANK4 varchar(1),
AVAILABILITYCODE varchar(1),
BLANK5 varchar(1),
IMAGESTARTINGLOCATION varchar(18),
BLANK6 varchar(1),
IMAGELENGTH varchar(9),
BLANK7 varchar(1),
FRONTBACKINDICATOR varchar(1),
AMOUNT varchar(10),
SERIAL varchar(10),
INTERNALUSE2 varchar(17),
ROUTINGTRANSIT varchar(9),
AMOUNT2 varchar(10),
CHECKNUMBER varchar(15),
POSTEDDATE varchar(8),
INTERNALUSE3 varchar(15),
CORRECTIONINDICATOR varchar(1),
Blanks varchar(338),
_StuffedColumn char(2) default '\r\n'
);
Re:Re:Re:Re:Re:Re:Problem with line feed: Reading text file on Linux
HXTT Support
2006-12-19 17:04:47.0
You can try:
_StuffedColumn longvarchar default '\n'
Then it can be platform independence.

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap