Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.131
  HXTT Cobol 5.0.131
  HXTT DBF 7.1.132
  HXTT Excel 6.1.135
  HXTT Json 1.0.103
  HXTT Paradox 7.1.131
  HXTT PDF 2.0.131
  HXTT Text(CSV) 7.1.131
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Word 1.1.131
  HXTT XML 4.0.132
Offshore Outsourcing
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
   
   
   
Heng Xing Tian Tai Lab of Xi'an 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
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap